Tutorial/debug 1.7: Difference between revisions

From OpenComputers: Rebooted
Jump to navigation Jump to search
imported>OCDoc Import
Imported from legacy OpenComputers documentation at ocdoc.cil.li
 
Clean up Markdown artifacts from DokuWiki migration
 
Line 1: Line 1:
= ====== Steps to Build and Run master-MC1.7.10 from source =
= ====== Steps to Build and Run master-MC1.7.10 from source =


These instructions assume you have cloned the repo, `git clone git@github.com:MightyPirates/OpenComputers.git` and are working from the master-MC1.7.10 branch, currently the default branch.
These instructions assume you have cloned the repo, <code>git clone git@github.com:MightyPirates/OpenComputers.git</code> and are working from the master-MC1.7.10 branch, currently the default branch.


== IDEA instructions ==
== IDEA instructions ==


# run `./gradlew setupDecompWorkspace`
= run <code>./gradlew setupDecompWorkspace</code> =
# run `./gradlew build`
= run <code>./gradlew build</code> =
# run `./gradlew idea`
= run <code>./gradlew idea</code> =
# From IDEA, open the OpenComputers.ipr created from `./gradlew idea`
= From IDEA, open the OpenComputers.ipr created from <code>./gradlew idea</code> =
# Open File->Project Structure (or press Shift+Control+Alt+S)
= Open File->Project Structure (or press Shift+Control+Alt+S) =
# In the left pane select Modules
= In the left pane select Modules =
# Depending on how you imported the project there may be mulitple top level modules. There should only be one. Keep only the one named OpenComputers which has three sub modules named `OpenComputers_api`, `OpenComputers_main`, and `OpenComputers_test`. Right click on the others and choose to delete them.
= Depending on how you imported the project there may be mulitple top level modules. There should only be one. Keep only the one named OpenComputers which has three sub modules named <code>OpenComputers_api</code>, <code>OpenComputers_main</code>, and <code>OpenComputers_test</code>. Right click on the others and choose to delete them. =
# Set separate output paths for `OpenComputers_api` and `OpenComputers_main`. In the middle pane select `OpenComputers_api`, in the right pane select "Paths" and change the "Output path:" from ending in /main to end in /api
= Set separate output paths for <code>OpenComputers_api</code> and <code>OpenComputers_main</code>. In the middle pane select <code>OpenComputers_api</code>, in the right pane select "Paths" and change the "Output path:" from ending in /main to end in /api =
# Set the scope of other minecraft mods in Dependencies "provided". This needs to be done for `OpenComputers_api` as well as `OpenComputers_main`. Select "Dependencies" in the right pane. A large list of dependencies are listed. All, by default due to importing the gradle properties, will default to "Compile". Set all of the following to "Provided"
= Set the scope of other minecraft mods in Dependencies "provided". This needs to be done for <code>OpenComputers_api</code> as well as <code>OpenComputers_main</code>. Select "Dependencies" in the right pane. A large list of dependencies are listed. All, by default due to importing the gradle properties, will default to "Compile". Set all of the following to "Provided" =
#* factorization-api
#* factorization-api
#* ic2classic-api
#* ic2classic-api
Line 63: Line 63:
#* Gradle: codechicken:ForgeMultipart
#* Gradle: codechicken:ForgeMultipart
#* Gradle: mantle:Mantle
#* Gradle: mantle:Mantle
# Again, make sure you repeat this process for both `OpenComputers_api` as well as `OpenComputers_main`.
= Again, make sure you repeat this process for both <code>OpenComputers_api</code> as well as <code>OpenComputers_main</code>. =
# Close Project Structure window (press OK)
= Close Project Structure window (press OK) =
# Open Run->Edit configurations, select Application on the left pane, and set `Use classpath of module` (left Alt+O) to `OpenComputers.main` for both `Minecraft Client` and `Minecraft Server`. This fixes the error `Error: Could not find or load main class GradleStart` if you forgot to do this step.
= Open Run->Edit configurations, select Application on the left pane, and set <code>Use classpath of module</code> (left Alt+O) to <code>OpenComputers.main</code> for both <code>Minecraft Client</code> and <code>Minecraft Server</code>. This fixes the error <code>Error: Could not find or load main class GradleStart</code> if you forgot to do this step. =
# Build Project (Shift F9)
= Build Project (Shift F9) =
# Make symlink called `assets` to `build\resources\main\assets` in folders `build\classes\java\main` and `build\classes\scala\main`. Otherwise textures and other assets won't work.
= Make symlink called <code>assets</code> to <code>build\resources\main\assets</code> in folders <code>build\classes\java\main</code> and <code>build\classes\scala\main</code>. Otherwise textures and other assets won't work. =
# Select "Minecraft Client" as the run target, and run!
= Select "Minecraft Client" as the run target, and run! =


<pre>Keep in mind that if you want to build a .jar that can be used outside of the development environment, you need to run `./gradlew clean` and then `./gradlew assemble` to produce .jar with obfuscated names so that it works with normal minecraft.
<pre>Keep in mind that if you want to build a .jar that can be used outside of the development environment, you need to run ./gradlew clean and then ./gradlew assemble to produce .jar with obfuscated names so that it works with normal minecraft.
</pre>
</pre>
== Contents ==
== Contents ==


{{:Tutorial/contents}}
{{:Tutorial/contents}}

Latest revision as of 20:28, 24 August 2026

====== Steps to Build and Run master-MC1.7.10 from source

These instructions assume you have cloned the repo, git clone git@github.com:MightyPirates/OpenComputers.git and are working from the master-MC1.7.10 branch, currently the default branch.

IDEA instructions

run ./gradlew setupDecompWorkspace

run ./gradlew build

run ./gradlew idea

From IDEA, open the OpenComputers.ipr created from ./gradlew idea

Open File->Project Structure (or press Shift+Control+Alt+S)

In the left pane select Modules

Depending on how you imported the project there may be mulitple top level modules. There should only be one. Keep only the one named OpenComputers which has three sub modules named OpenComputers_api, OpenComputers_main, and OpenComputers_test. Right click on the others and choose to delete them.

Set separate output paths for OpenComputers_api and OpenComputers_main. In the middle pane select OpenComputers_api, in the right pane select "Paths" and change the "Output path:" from ending in /main to end in /api

Set the scope of other minecraft mods in Dependencies "provided". This needs to be done for OpenComputers_api as well as OpenComputers_main. Select "Dependencies" in the right pane. A large list of dependencies are listed. All, by default due to importing the gradle properties, will default to "Compile". Set all of the following to "Provided"

    • factorization-api
    • ic2classic-api
    • AgriCraft
    • Gradle: appeng:RotaryCraft:api
    • Gradle: appeng:appliedenergistics2
    • Gradle: codechicken:EnderStorage
    • Gradle: codechicken:WR-CBE
    • Gradle: com.bluepowermod:BluePower
    • Gradle: com.gregoriust.gregtech
    • Gradle: igwmod:IGW-Mod-1.7.10
    • Gradle: li.cil.tis3d:TIS-3D
    • Gradle: mcp.mobius.waila
    • Gradle: net.industrial-craft:industrialcraft-2
    • Gradle: net.sengir.forestry
    • Gradle: dev.modwarriors.notenoughkeys:NotEnoughKeys
    • Gradle: qmunity:QmunityLib
    • Gradle: tmech:TMechworks
    • Gradle: mrtjp:ProjectRed
    • Gradle: :buildcraft
    • Gradle: :GalacticraftCoreAll
    • Gradle: :MekanismAll
    • Gradle: :redlogic
    • Gradle: :CoFHLib
    • Gradle: :CoFHCore
    • Gradle: :MineFactoryReloaded
    • Gradle: :ComputerCraft
    • Gradle: :EnderIO
    • Gradle: :Railcraft
    • Gradle: :BloodMagic
    • Gradle: :ExtraCells
    • Gradle: :ThaumicEnergistics
    • Gradle: api:rf
    • Gradle: codechicken:CodeChickenCore
    • Gradle: api:mfr
    • Gradle: api:railcraft
    • Gradle: appeng:mekanism
    • Gradle: api:ic2
    • Gradle: api:betterstorage
    • Gradle: api:immibis
    • Gradle: api:coloredlightscore
    • Gradle: api:craftguide
    • Gradle: api:rblocks
    • Gradle: api:invtweaks
    • Gradle: appeng:Waila
    • Gradle: tconstruct:TConstruct
    • Gradle: codechicken:NotEnoughItems
    • Gradle: codechicken:CodeChickenLib
    • Gradle: codechicken:ForgeMultipart
    • Gradle: mantle:Mantle

Again, make sure you repeat this process for both OpenComputers_api as well as OpenComputers_main.

Close Project Structure window (press OK)

Open Run->Edit configurations, select Application on the left pane, and set Use classpath of module (left Alt+O) to OpenComputers.main for both Minecraft Client and Minecraft Server. This fixes the error Error: Could not find or load main class GradleStart if you forgot to do this step.

Build Project (Shift F9)

Make symlink called assets to build\resources\main\assets in folders build\classes\java\main and build\classes\scala\main. Otherwise textures and other assets won't work.

Select "Minecraft Client" as the run target, and run!

Keep in mind that if you want to build a .jar that can be used outside of the development environment, you need to run ./gradlew clean and then ./gradlew assemble to produce .jar with obfuscated names so that it works with normal minecraft.

Contents

Tutorials
Mod Specific Basic Computer - Writing Code - Hard Drives - Autorun and Startup scripts
Modding Custom Architectures - IMC Messages
Programs OPPM - install
Others Custom Operating Systems