New decompile-free faster build process#506
New decompile-free faster build process#506agaricusb wants to merge 6 commits intoForgeEssentials:masterfrom
Conversation
Build with: mvn initialize mvn package
net.minecraft.command.CommandBase implements ICommand which in turn implements Comparable, but CommandBase's compareTo() method to satisfy this interface is synthetic and wrapping compareNameTo(). Not picked up by the compiler, so add it in ForgeEssentialsCommandBase ourselves for now.
Maven doesn't like multiple source roots..
|
|
I will try and test out how this is gona go and stuff, and if we can afford to bring it in without changing our structure too much. |
|
I he can show me how to implement this on our jenkins, I'm all for it. |
|
uh, i guess you can start by installing maven... |
|
If is installed by jenkins I beleve, Or you can do it, you have sudo rights. |
|
i have set jenkins up already, look in fe-betas-mvnexperimental |
Cool, thanks guys for your willingness to try out this crazy new build technique. There might be some kinks to work out in the process, but if successful for a project as large as FE, I think it won't be long before other mods can adopt it as well. Couple things:
It can call out to arbitrary plugins, but Maven has something better built-in, eliminating the need for external processes: resource filtering. ${...} variables will be expanded in directories when true. Still need to find out how to substitute the version in code, however.. CraftBukkit reads the version dynamically from the version.properties in the jar, but I couldn't find out how to get this to work with FML annotations, which required constants only (a final variable initialized in a static initializer was insufficient).
Well I couldn't get FE_SRC_COMMON to compile without it.. there's a way to add multiple source directories but it has some possible issues. Another alternative is compiling libs in a separate project then adding it as a dependency.
Sure. SS now supports access transformers, so FE compiles against a 'minecraft-forge+forgeessentials' dependency which has your AT's applied. The dependency doesn't have other ASM transformers executed on it, but since its only used for compilation, this should not matter unless you use ASM to add new symbols in net.minecraft (doesn't seem that FE does this) and reference them statically. The ASM transformers still run at runtime. Also the FMLCorePlugin property is added in the manifest with maven-jar-plugin.
Sweet
There's still a need to remap to the numeric "srg" names, from the descriptive "csv" names used in MCP. Haven't started looking into 1.5 yet but I expect a fairly similar setup to work (probably with true to avoid reading the .csvs).
Fortunately Maven can handle custom directory configurations, normally source is in src/main/java but I set it to ${basedir}/src/FE_SRC_COMMON; same with resources. Some of the files however couldn't find a reasonable way to fit them in. Currently these projects are not available on Maven Central; have to be built and installed from source until then.. working on getting this fixed soon |
|
To be faire, I don't care if you have to recompile the libs if you cut down |
|
@dries007, what's done is done, actually. |
On my system this process builds FE in 5 seconds =)
Ah I see.. hmm. Not sure how to create this "zip of zips" with Maven. I see what Abrar was saying earlier now about how building ForgeEssentials with Gradle may be easier, since it has a more expressive language for specifying the build steps than Maven, and it would probably be easier to convert existing shell scripts, especially for this double-zipping process. Should be possible nonetheless. Maybe remapping using SpecialSource with Gradle instead of Maven; this would consist of converting the SpecialSourceMP plugin to Gradle. SS is fairly modular so this wouldn't be too diffcult; SSMP is just a thin wrapper around SS. Something to investigate.. I'll close this PR for now; the changes are on https://github.com/ForgeEssentials/ForgeEssentialsMain/tree/experimental. I'll also keep my branch at https://github.com/agaricusb/ForgeEssentialsMain/tree/maven-dev updated with the latest experimental changes as this process is refined; anything you need catch me on IRC. |
|
Sure. |
Adds a new and improved (but experimental) build process as discussed with @AbrarSyed on IRC earlier (just missed you on #minecraftforge today). Removes the need for MCP, decompilation, and excessive recompilation – in favor of a brand new SpecialSource-based remapper currently executed via Maven.
Builds FE in ~7 seconds on my system.
Known issues:
However, it does produce a usable build (run with 'mvn initialize' then 'mvn package', mod will be in target/). Again it is still experimental, but if FE wants to be a pilot mod for SSMP.. :) Probably needs further testing before pulling (although note both build processes can coexist).