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

Gradle warning with createBuildTimestamp task #3

Closed
aVolpe opened this issue Oct 20, 2022 · 1 comment · Fixed by #8
Closed

Gradle warning with createBuildTimestamp task #3

aVolpe opened this issue Oct 20, 2022 · 1 comment · Fixed by #8

Comments

@aVolpe
Copy link
Contributor

aVolpe commented Oct 20, 2022

When running the test task, the following warning is printed:

  - Gradle detected a problem with the following location: 'repo/modules/module/build/resources/main'. Reason: Task ':modules:module:compileTestJava' uses this output of task ':modules:module:createBuildTimestamp' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.5.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.
  - Gradle detected a problem with the following location: 'repo/modules/module/build/resources/main'. Reason: Task ':modules:module:compileTestJava' uses this output of task ':modules:module:createGitRevision' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.5.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.

We can use this plugin as an example to how to fix those warnings: https://github.com/n0mer/gradle-git-properties/blob/master/src/main/groovy/com/gorylenko/GitPropertiesPlugin.groovy

@aVolpe
Copy link
Contributor Author

aVolpe commented Sep 28, 2023

To use the plugin version <0.0.4 with gradle 8, add this to every module that uses the plugin:

classes.dependsOn ':module:$NAME:createBuildTimestamp', ':module:$NAME:createGitRevision'

aVolpe added a commit to aVolpe/jpos-gradle-plugin that referenced this issue Sep 28, 2023
The plugin can now be configured using a 'jpos' directive in the .gradle file:

```groovyjpos {
    target = "devel"
    addGitRevision = true
    addBuildTime = true
    archiveJarName = "${project_name}-${version}.jar"
    archiveWarName = "${project_name}-${version}.war"
    installDir = build/install/${project_name}
    distDir = src/dist
}
```

A non trivial refactor of the plugin was made to ensure that those properties
can be configured and used as described in the README.

This commit also makes this plugin compatible with gradle 8, so it fixes jpos#3

The configurability of git revision data also fixes jpos#5.

And it can be a workaround for jpos#7 using a different distDir.

Signed-off-by: Arturo Volpe <[email protected]>
aVolpe added a commit to aVolpe/jpos-gradle-plugin that referenced this issue Sep 28, 2023
The plugin can now be configured using a 'jpos' directive in the .gradle file:

```groovy
jpos {
    target = "devel"
    addGitRevision = true
    addBuildTime = true
    archiveJarName = "${project_name}-${version}.jar"
    archiveWarName = "${project_name}-${version}.war"
    installDir = build/install/${project_name}
    distDir = src/dist
}
```

A non trivial refactor of the plugin was made to ensure that those properties
can be configured and used as described in the README.

This commit also makes this plugin compatible with gradle 8, so it fixes jpos#3

The configurability of git revision data also fixes jpos#5.

And it can be a workaround for jpos#7 using a different distDir.

Signed-off-by: Arturo Volpe <[email protected]>
@ar ar closed this as completed in #8 Sep 28, 2023
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 a pull request may close this issue.

1 participant