Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module experiment - build harness #87

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open

Conversation

Cervator
Copy link
Member

@Cervator Cervator commented Nov 4, 2017

Setting up PR for easier overview and to have somewhere to put notes. Note that this is just very recent work, there is other new stuff in this fork prior to this PR, and somehow this repo is already 800 commits behind upstream, sigh :-) (note: master is effectively my develop here ... err, yeah. It could be clearer)

The main goal to this piece is reorganizing some of the Gradle and template file stuff to both make things cleaner (collapsed two dirs into /gradle that won't be interesting to most users) and to allow an easy way to assemble a build harness zip that can be dumped on a standalone module directory to allow it to build using the exact same build files.

The reasoning behind that is two-fold:

  • Allow Jenkins to more easily acquire the build files needed to run a module build (remember: module repos are not allowed to have build scripts) - this way Jenkins can just fetch a zip rather than worry about having the engine job archive a bunch of loose files then copy them in first
  • Allow a user to run a module build locally without an engine workspace. This may seem silly at first, since why wouldn't you just use an engine workspace?
    • The main repo is getting pretty chunky - it can take a long time to clone especially on weaker connections. This way you just need a single game zip (or even less - see below). Previously you could mod assets easily enough but it was some hassle to manually copy in stuff needed to compile
    • A new function will be added so groovyw module init will initialize the build harness as a module dir, name taken by the parent dir. Add assets + code, gradlew jar, copy jar into regular game module dir or share it with a friend
    • Occasionally we need to actually see how a module builds / publishes solo. Usually for testing something that may have an impact on Jenkins

It may even be possible to include a command that'll run the game right out of a standalone module directory. After all the Gradle already depends on the engine jar and so on. So it might be possible to not even have a full game dir, just whatever Gradle fetches from Artifactory

One additional major issue is being experimentally addressed: when a solo module build does run it tends to fail if there are environment-based unit tests present, because execution ends up starting in the Gradle cache. I came up with a check for PathManager that seems to get you back to the module dir, and the process now gets past that part, but oddly seems to fail on some module sandbox setup issue now. Am curious if @kaen or @oniatus might have a clue there.

Note that to run this I recommend a separate workspace - do not try this at home (in your regular workspace) :D

The gradle.properties in the template dir may be needed to make sure configuration on demand is off. I'm working split away from the regular MovingBlocks and Terasology orgs, in Artifactory as well. One other issue is that modules retrieved from Artifactory will tend to come with a dependency on a specific version of the engine, which can make it harder to test things when you have related changes in a local source engine. I've got some clues on how to fix that as well but in the meantime have used bumping the engine version to 1.6.1 then using gradlew engine:install to get a newer version in my local cache that'll get used instead of something from Artifactory without my changes.

Right now this just works in Gradle. I had clues to fix IntelliJ but it brings a lot of hassle, in particular without any sort of IntelliJ customizations (just standard Gradle stuff)

Next up I'll be testing this in Jenkins with new pipelines. Lots of stuff still to do but it is looking promising.

oniatus and others added 21 commits January 2, 2017 16:17
… do.

- Upgrades to Gradle 3.3 from 2.10
- Removes the need for module directories to have a build.gradle
- Related cleanup / simplification of scripts
- Bakes in support for alternative module languages into new /modules Gradle scripts via new "language" property in module.txt
…hink it was something like ...

- removes the IDE configurations :-(
- tries to find a hook for a prep task (to extract natives, code analysis config, and copy templates)
- fixes a Gradle structure / resolution performance issue
- adds the Groovy Wrapper that I since added to the main project so this one is already out of date
…isn't present here but there is still a dependency quirk that causes modules to end up depending on a snapshot of the engine rather than local engine src, so Gradle included the telemetry dependency from the jar and then couldn't find it (as it exists in a separate artifact repository)
… in pure Gradle, it makes IntelliJ barf with an unintelligible error on a Gradle refresh. However, oddly, the same exact thing on a testCompile instead of a regular compile source set works fine.
…le knows where to find it if needed via module->engine snapshot quirk
…anage to erase them accidentally again. Includes Gradle 4 and some related changes.
…rking in a standalone module workspace.

Should clean up later, the Artifactory block is all over the place now.
Must be a way to shrink that down.
Seems to let the unit tests in Pathfinding work out the directory, but
then a module sandboxing quirk appears?
@Cervator Cervator added the Gradle label Nov 4, 2017
@GooeyHub
Copy link

GooeyHub commented Nov 4, 2017

Jenkins Failure Message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants