Gradle Release Plugin Bookmarks

Published: 2017-08-27, Updated: 2020-06-15

Fazendo releases de aplicacoes com gradle

O lifecycle desse plugin é o seguinte:

Ou seja, o numero que foi gerado agora só será release na proxima geração de release, ex:


plugins {
	id 'net.researchgate.release' version '2.7.0'
}

release {
	project.ext.set("release.useAutomaticVersion", true)
	git {
		requireBranch = ''
	}
	failOnCommitNeeded = false
	failOnPublishNeeded = false
	failOnUnversionedFiles = false
	buildTasks = []
}

// se quiser que fique com o numero da nova versao
updateVersion.doLast {
	println("Updating docker-compose.yml")
	def f = file("${project.projectDir}/docker-compose.yml")
	def text = f.text
	f.withWriter { w ->
		w << text.replaceAll("(:\\ )*\\d+\\.\\d+\\.\\d+", "\$1${version}")
	}
}

// se quiser que fique com o numero da versao que foi gerada release 
confirmReleaseVersion.doLast {
	println("Updating docker-compose.yml")
	def f = file("${project.projectDir}/docker-compose.yml")
	def text = f.text
	f.withWriter { w ->
		w << text.replaceAll("(:\\ )*\\d+\\.\\d+\\.\\d+", "\$1${version}")
	}
}

Especificar a versao

$ gradle release -Prelease.releaseVersion=1.0.0 -Prelease.newVersion=1.1.0-SNAPSHOT

gradle release commands, gradle release examples, gradle release bookmarks


Programmer Utils Saving data to two JDBC tables granting atomicity in Apache Spark

Comments