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

Moved versioning plugin to the root only. #174

Closed

Conversation

lkishalmi
Copy link

@lkishalmi lkishalmi commented Oct 7, 2016

Moved versioning plugin to the root only making versioning still resolvable by sub-projects, but evaluating the info only once. As the evaluation is happened on the configuration time,
this change speeds up the configuration time with a few seconds (4-7 for me).

The evaluation of that info also has been pushed into the execution
phase, at least for the jar task.


This change is Reviewable

versioning still resolvable by sub-projects, but evaluating the info
only once. As the evaluation is happened on the configuration time,
this change speeds up the configuration time with a few seconds
(4-7 for me). 
The evaluation of that info also has been pushed into the execution
phase, at least for the jar task.
@aalmiray
Copy link
Member

aalmiray commented Oct 7, 2016

Review status: 0 of 2 files reviewed at latest revision, 2 unresolved discussions, some commit checks broke.


build.gradle, line 54 at r1 (raw file):

apply plugin: 'jacoco'
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'net.nemerosa.versioning'

this change applies the versioning plugin immediately at the root level, not in specific subprojects


gradle/publish.gradle, line 93 at r1 (raw file):

jar {
    doFirst {

I suppose moving the calculation of manifest entries to execution time does make the build faster, as it only happens if the jartask is found in the task graph. thanks for spotting this! 😄


Comments from Reviewable

@aalmiray
Copy link
Member

aalmiray commented Oct 7, 2016

Reviewed 2 of 2 files at r1.
Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks broke.


Comments from Reviewable

@lkishalmi
Copy link
Author

(Just for correctness:) Well putting the manifest into doFirst is not only speeds up the build when the jar task not in the task graph, but it pushes the execution time out of Gradle's configuration phase.

Before this change it was executed regardless the jar task were on the task graph or not.

@aalmiray
Copy link
Member

aalmiray commented Oct 7, 2016

Agreed. I think the doFirst change is good to go however I'd like to keep the application of the versioning plugin inside the publishing.gradle script instead of at the root level.

@lkishalmi
Copy link
Author

Reverted the publish -> root project movement of the versioning plugin.

@aalmiray
Copy link
Member

aalmiray commented Oct 9, 2016

Your original PR made me think that it makes better sense to calculate the GIT hash once, same thing with other on-the-fly values. This means moving the versioning plugin at the root level as you originally proposed, but also adding variables to the root's ext block.

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

Successfully merging this pull request may close these issues.

2 participants