Comments (4)
I was able to work around this.
I was having this issue only in Kotlin builds, and not in Groovy builds.
This build.gradle
works (tag is made without -SNAPSHOT
):
plugins {
id 'net.researchgate.release' version '3.0.2'
}
release {
tagTemplate = 'v${version}' // note: single quotes
}
But this gradle.kts
does not (tag is X.X.X-SNAPSHOT):
plugins {
id("net.researchgate.release") version "3.0.2"
}
release {
tagTemplate.set("v${version}") // note: double quotes
}
This seems to be a runtime interpolation issue. Once I escaped the dollar sign, things worked:
plugins {
id("net.researchgate.release") version "3.0.2"
}
release {
tagTemplate.set("v\${version}")
}
from gradle-release.
Same for me,
I have the following build.gradle
import java.time.LocalDate
import java.time.format.DateTimeFormatter
plugins {
id 'org.springframework.boot' version '2.7.0'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id 'net.researchgate.release' version '3.0.2'
}
group = 'eu.lbase'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
test {
useJUnitPlatform()
}
release {
failOnCommitNeeded = false
failOnUnversionedFiles = false
def version = '${version}'
def isoDate = LocalDate.now().format(DateTimeFormatter.BASIC_ISO_DATE)
tagTemplate = "v_${version}-${isoDate}"
git {
requireBranch.set('')
}
}
Now, when I start with the gradle build (v7.5.1) -->
gradlew clean build bootJar release -Prelease.useAutomaticVersion=true
I only find Snapshot jars in directory build/libs/
from gradle-release.
I was experiencing the same problem. However, in my case, the issue was that the version property from the .kts script was taking preference over the gradle.properties
file.
from gradle-release.
I am experiencing the same problem, but might have a hint on where to look: It seems this behavior is connected to the tagTemplate. With only the following block in the build.gradle.kts
file, everything works fine:
configure<ReleaseExtension> {
failOnUnversionedFiles.set(false)
with(git) {
requireBranch.set("master")
}
}
i.e. running gradlew release -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=0.16.0 -Prelease.newVersion=0.17.0-SNAPSHOT
creates a tag called 0.16.0
and changes version in gradle.properties
to 0.17.0-SNAPSHOT
.
However, if I add tagTemplate.set("v${version}")
to build.gradle.kts
and run gradlew release -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=0.17.0 -Prelease.newVersion=0.18.0-SNAPSHOT
, I get a tag called v0.17.0-SNAPSHOT
(i.e. content of gradle.properties pre-release) and a new snapshot version 0.18.0-SNAPSHOT
.
Based on some quick skimming of the code, the issue seems to be in PluginHelper#tagName():
String tagName() {
def engine = new SimpleTemplateEngine()
def binding = [
"version": project.version,
"name" : project.name
]
return engine.createTemplate(extension.tagTemplate.get()).make(binding).toString()
}
The property used for the tag template seems to be project.version
, however, when using useAutomaticVersion
in conjucntion with an explicitly set version, that version is set through property release.releaseVersion
, so I guess this would have to be available to the tag template as well.
from gradle-release.
Related Issues (20)
- Leading space inserted for title of pre tag commit HOT 3
- "Extension with name 'release' does not exist" for 3.0.0, Gradle 7.5 and multiproject HOT 1
- Build failing after upgrading to 3.0.0 HOT 3
- Release with protected branch HOT 1
- Update citation files on version change
- Ignoring requireBranch is not possible HOT 4
- Define Release Branch name Template
- 3.0.0 - buildTasks default changed from ['build'] to [] HOT 1
- :submodule:release stuck at unSnapshotVersion
- Cannot trigger task after release HOT 1
- release does not build HOT 1
- Question: Behavior of plugin while preparing new version commit
- Gradle 9.0: The StartParameter.settingsFile property has been deprecated. HOT 16
- Use updateVersion with args HOT 1
- I have a new idea to incorporate this feature into the plugin for the purpose of using dynamic version dependencies
- Composite build not supported HOT 2
- Failure on releasing jni projects
- Unable to configure releases with protected main branch in Gradle HOT 1
- Failure with Gitlab 16.8.1 (No user exists for uid 503) HOT 1
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-release.