-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix/transient deps #4343
Fix/transient deps #4343
Changes from 7 commits
b8d7f2a
5cfcf10
ef739b4
e821433
1f325e7
c15b055
1f59ade
f383cb1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2020 The Terasology Foundation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
plugins { | ||
`java-platform` | ||
} | ||
|
||
javaPlatform { | ||
allowDependencies() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly here I fully expect that this works, but is allowing dependencies not a default state of some sort? That seems odd. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is the case! By default, gradle's java-platform is a thing that specifies version constraints, but consumers can depend on the platform without depending on everything in it. that scenario probably looks more like: dependencies {
implementation(platform("com.example.foo:foo-framework:3"))
implementation("com.example.foo:foo-core")
implementation("com.example.foo:foo-http-server")
} to say "I need these things from Foo Framework v3, make sure all versions are consistent with what they've published as v3 of that platform." In order to say this platform depends on things we have to explicitly enable set this flag. |
||
} | ||
|
||
dependencies { | ||
// This platform depends on each of its subprojects. | ||
subprojects { | ||
runtime(this) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I figure this builds the runtime classpath so all the module jars are available to the engine. This reminds me of that old idea to make the PC facade have a compile dependency on all the modules, to have them for sure get built when you run the game. Although at the cost of not being able to launch without every single module working, and maybe at a risk to get weird dependencies written into the binaries published to Artifactory. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, that's exactly what is happening when the facade depends on the platform.
I think we already sacrificed that ability a while ago? Test plan:
I think because the I haven't yet come across a gradle way to always attempt to rebuild dependency subprojects if their sources changed but also soft-fail and try to run subsequent steps despite that. You can There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
yes, if you publish a jar of the PC facade while you have subprojects present in Is that a thing that happens? Does anything publish facade that's not in a clean workspace made explicitly for that purpose? If so, then yeah, we'll have to add more separation so this local workspace state isn't confused with what we want to publish to the world. I hadn't imagined it was used that way. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gradle will always hit the issues, yep, IntelliJ has had a tendency in the past to skip errors if they're in something the run config doesn't care about. I'm not sure about that now since we're having some other weird issues there from time to time :-) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I didn't see this comment earlier while posting my own for some reason. No, that isn't done anywhere at the moment. And any sort of test-publishing we might do locally surely should target something like the Nanoware test repos in Artifactory. It is good to know though, in case we get creative and weird in the future. One idea that floated around was to build modules in an actual full engine workspace, rather than the minified single-module workspace we run in Jenkins right now. Even that in theory shouldn't hit it - since that should just publish the module, not the facade. So - not worried about it. May be worth highlighting with a comment perhaps :-) |
||
} | ||
} | ||
|
||
// Allows using :modules:clean as a shortcut for running clean in each module. | ||
tasks.named("clean").configure { | ||
val cleanPlatform = this | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again understanding what this does, but Would something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh yes, I got that part. Thus the "almost like" 😁 Like in the abstract this class could as well have been called "cleanPlatform" or "cleanAllModules" - plain "cleanPlatform" just throws me off as a variable name the way it gets used, but that's very minor and probably just me 👍 |
||
subprojects { | ||
cleanPlatform.dependsOn(this.tasks.named("clean")) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be worth adding a quick comment here? I'm not even sure what "platform" even means here, although I can figure what the overall meaning is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can do