Repository navigation
Move to unified gradle build - #1835
Conversation
0d19869 to
ee92735
Compare
chanseokoh
left a comment
There was a problem hiding this comment.
Whatever it's doing, I like moving away from the current setup where we copy source directories of other projects. I gave a try in Eclipse.
In Eclipse, looks like I need to import 5 Gradle projects, which doesn't look wrong: jib, jib-core, jib-gradle-plugin, jib-maven-plugin, jib-plugins-common.
Now, I had to additionally configure extra build path through the IDE mechanism. jib-gradle-plugin and jib-maven-plugin could not see classes in jib-core, so I had to add jib-core as an additional dependent project for them. Interestingly, I did not have to add jib-plugins-common as an explicit project dependency. I wonder if this is also the case in IntelliJ.
Now, unrelated, I was always not really a fan of making src/main/resources and src/[integration-]test/resources as Java source files. Conceptually, this doesn't make sense, because resources there are not project source. (I know they were added as "source" for the sake of convenience in running tests.) Consequently, Eclipse sees the test resources whose extension is .java as the genuine project source to compile and include, hence showing compilation failure. I have been manually excluding some sub-directories (e.g., ...test/resources/gradle/projects) through the IDE build path to let it not think they are project source.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
ee92735 to
0d2a481
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
22e38b8 to
9a0672f
Compare
| cd github/jib/jib-core | ||
| ./gradlew prepareRelease | ||
| cd github/jib | ||
| ./gradlew :jib-core:prepareRelease |
There was a problem hiding this comment.
I'm not actually convinced this matches up with our release scripts, I'll have to see.
|
some of these changes can probably be broken out into unrelated fixes, I'll do that to make this isolated to the build stuff. |
9a0672f to
dd1c289
Compare
This comment has been minimized.
This comment has been minimized.
7c90542 to
1c6636f
Compare
| } | ||
| } | ||
| tasks.publishPlugins.dependsOn integrationTest | ||
| //tasks.publishPlugins.dependsOn integrationTest |
There was a problem hiding this comment.
I need to uncomment this
1c6636f to
ce56aa0
Compare
|
We'll probably need to update CONTRIBUTING.md as well. |
1f44fee to
d9f495a
Compare
|
This should be ready now to look at. |
448b483 to
ec61dab
Compare
TadCordle
left a comment
There was a problem hiding this comment.
Tried this on my laptop and it feels a lot nicer/simpler. LGTM once eclipse is confirmed to work.
|
Yeah, definitely this is a lot nicer. No more copying source directories, and I really like it. For the record, the outcome of the most recent try on Eclipse:
This is still true, unfortunately. Not a big deal for me, as I only have to do this once and it's done.
This was probably due to my lack of understanding of this thing. The old setup had the same problem; nothing new. I learned running test on the command line just generates this file. Once generated, I'm good.
No longer the case. No need to add an extra classpath. It works now. Or maybe I just misunderstood this part back then. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@chanseokoh about the javadoc, are you sure the bad |
|
Yeah, it does fail. Didn't realized it only works for public things. |
|
Is there more work to be done on this or is this good to go? |
|
I gotta rebase on the 1.5.1 release, but other than that, yeah |
- also upgrades gradle to 5.2.1 - all builds should happen from root :<project>:<task>, build.sh removed - tests that run the plugin may not work in IDEs unless correct setup task run first - special eclipse helpers to clear up classpath - adds protections for transitive dependency overrides
3b2ae76 to
58699ef
Compare
|
|
||
| // Use this to ensure we correctly override transitive dependencies | ||
| // TODO: There might be a plugin that does this | ||
| task ensureTransitiveDependencyOverrides { |
There was a problem hiding this comment.
This is some new code to protect against us accidentally import httpclient of a different version transitively. It does the job, but I worry about the maintainability, as there may not be a way to know if it suddenly stops working. I guess currently it works, worst case it may not work.
Fixes #1790.
prerequisites to merging:
post-merge
about:
./gradlew buildor./gradlew <anytask>will run on all projects./gradlew <subproject>:buildwill limit the build to a subproject and it's dependencies./gradlew jib-gradle-plugin:pluginUnderTestMetadata./gradlew jib-maven-plugin:install./gradlewdirectlyimplementationand are exported to runtime (not compile) scope transitively.