Comments (5)
Yup that works! Thanks!
from gradle-git-versioning-plugin.
sounds reasonable.
from gradle-git-versioning-plugin.
Can you provide the commands to reproduce the problem?
However I think I was able to solve your problem by moving the logic to doLast
// ...
public VersionTask() {
doLast((task) -> {
System.out.println(task.getProject().getVersion());
});
}
// ...
from gradle-git-versioning-plugin.
doLast {}
won't work :)
To produce make sure that you have Gradle configuration cache enabled https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:usage:enable
I've set it in gradle.properties
:
org.gradle.unsafe.configuration-cache=true
org.gradle.unsafe.configuration-cache-problems=warn
I can't link directly to the bit in the Gradle docs, so here's a screenshot
from gradle-git-versioning-plugin.
final fix was quite simple :-)
public class VersionTask extends DefaultTask {
private final Object projectVersion = getProject().getVersion();
@TaskAction
void printProjectVersion() {
System.out.println(projectVersion);
}
}
feel free to try version 6.3.5
from gradle-git-versioning-plugin.
Related Issues (20)
- How to configure previous tag + -SNAPSHOT using GitHub Actions? HOT 5
- Tag refs ignored, pattern not recognised HOT 3
- How to use within a multi-module Gradle project? HOT 6
- Tag version issue with 6.4.0 when running in CircleCI HOT 5
- Latest release named 9.4.1 HOT 1
- Fix compatibility with Gradle `8.1` and Configuration Cache HOT 15
- Placeholder default value and describe.tag do not appear compatible
- Shortcut for next version bumped by major/minor/patch HOT 2
- org.eclipse.jgit.errors.MissingObjectException: Missing unknown <commit hash here> HOT 4
- release new version with updated version of dependency org.eclipse.jgit:org.eclipse.jgi HOT 3
- Clarify docs on ordered selection HOT 2
- [6.1.0] `./gradlew version` fails with "invalid provided ref nkiesel/main/StringBuilder - needs to start with refs/" HOT 16
- JVM compatibility error in buildSrc HOT 6
- ${describe.tag} behaviour inconsistent with $(git describe) HOT 5
- error message: Object [full hash of commit] is not a commit. HOT 10
- Plugin does not detect merged tags HOT 8
- Does it work with Java 8? HOT 6
- How to define the <VERSION> pattern. HOT 9
- describe.tag.version.major couses java.lang.NullPointerException when none tag fit to pattern HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradle-git-versioning-plugin.