Gradle Release plugin

The Gradle Release plugin makes releasing Gradle projects easy.

Лицензия

Лицензия

Категории

Категории

Gradle Компиляция и сборка
Группа

Группа

no.entitas.gradle
Идентификатор

Идентификатор

gradle-release-plugin
Последняя версия

Последняя версия

1.16
Дата

Дата

Тип

Тип

jar
Описание

Описание

Gradle Release plugin
The Gradle Release plugin makes releasing Gradle projects easy.
Ссылка на сайт

Ссылка на сайт

http://github.com/stianh/gradle-release-plugin
Система контроля версий

Система контроля версий

https://github.com/stianh/gradle-release-plugin

Скачать gradle-release-plugin

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/no.entitas.gradle/gradle-release-plugin/ -->
<dependency>
    <groupId>no.entitas.gradle</groupId>
    <artifactId>gradle-release-plugin</artifactId>
    <version>1.16</version>
</dependency>
// https://jarcasting.com/artifacts/no.entitas.gradle/gradle-release-plugin/
implementation 'no.entitas.gradle:gradle-release-plugin:1.16'
// https://jarcasting.com/artifacts/no.entitas.gradle/gradle-release-plugin/
implementation ("no.entitas.gradle:gradle-release-plugin:1.16")
'no.entitas.gradle:gradle-release-plugin:jar:1.16'
<dependency org="no.entitas.gradle" name="gradle-release-plugin" rev="1.16">
  <artifact name="gradle-release-plugin" type="jar" />
</dependency>
@Grapes(
@Grab(group='no.entitas.gradle', module='gradle-release-plugin', version='1.16')
)
libraryDependencies += "no.entitas.gradle" % "gradle-release-plugin" % "1.16"
[no.entitas.gradle/gradle-release-plugin "1.16"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.tmatesoft.svnkit : svnkit jar 1.7.5
com.jcraft : jsch jar 0.1.44-1
org.eclipse.jgit : org.eclipse.jgit jar 2.1.0.201209190230-r

test (4)

Идентификатор библиотеки Тип Версия
org.objenesis : objenesis jar 1.2
junit : junit-dep jar 4.9
org.spockframework : spock-core jar 0.6-groovy-1.8
cglib : cglib-nodep jar 2.2

Модули Проекта

Данный проект не имеет модулей.

Gradle release plugin (Git and Subversion) Build Status

This is a Gradle plugin that makes it very simple to automate release management when using git or Subversion as vcs. The plugin is responsible for knowing the version to build at all times. You should not use this plugin if you want/need to be in control of the version name/number.

In the case of a normal gradle build, the plugin generates a version name based on the current branch name: ${branchName}-SNAPSHOT.

If you run the task releasePrepare, the plugin will query git/svn for the latest release tag and add one to the number. The artifacts will have a version name like master-REL-1 (if this is the first time you run :releasePrepare). A release tag with the version name will be created in git/svn. (The tag will NOT be pushed in this task when using git.)

If you want the artifacts to be uploaded and the releaseTag to be pushed, run the releasePerform task. This task depends on releasePrepare so it will run first.

Notice: The build will fail if you try to run releasePrepare again, with an error message telling you that there is no changes since the last release tag. If you want to rebuild a release, just run a normal gradle build and the plugin will figure out that the current HEAD is a release tag and use the release version. The same applies if you checkout a release tag and run build.

Usage

Add the following to your build file to setup where the plugin should be downloaded from:

apply plugin: 'gitrelease' // or apply plugin: 'svnrelease'

buildscript {
  repositories {
    mavenCentral()
  }

  dependencies {
    classpath 'no.entitas.gradle:gradle-release-plugin:1.16'
  }
}

Notice: This must be in the root build file in a multi-module build, that is, the release plugin can only be applied at the top level.

To setup where your artifacts should be deployed, use a regular uploadArchives section. This is an example of deploying to a Maven repository:

uploadArchives.repositories.mavenDeployer {
  uniqueVersion = false

  repository(url: '...release distribution url...') {
    // username/password resolved from gradle.properties
    authentication(userName: project.username, password: project.password)
  }

  snapshotRepository(url: '...snapshot distribution url...') {
    // username/password resolved from gradle.properties
    authentication(userName: project.username, password: project.password)
  }
}

In a multi-module build this will typically be setup for each subproject that needs to be deployed.

Configuration

The closure below shows the available configuration options and their default values:

release {
    failOnSnapshotDependencies = false
    versionStrategy = { currentVersion ->
        if (System.properties['release.version']) {
            System.properties['release.version']
        } else {
            new BigDecimal(currentVersion).add(BigDecimal.ONE).toPlainString()
        }
    }
    startVersion = { currentBranch -> "1" }
}

failOnSnapshotDependencies when set to true the build will fail if it has any snapshot dependencies.

versionStrategy a closure for calculating the next version number, given the current (as a String). The default implementation is to add 1, or if the system property release.version is set, use its value.

startVersion which version to start counting from.

Tasks

releasePrepare

  • Checks that there are no local modifications (git/svn status)
  • Checks that your current HEAD is not a release tag
  • The projects are built with version resolved from the latest git release tag + 1
  • Creates a git tag for your current head named ${branchName}-REL-${version}

releasePerform

  • This task depends on the :releasePrepare task
  • Depends on uploadArtifacts and pushes tags if using git

Known issues and limitations

  • Only tested on Java projects
  • The releasePerform task has only been tested with Nexus and http upload

Версии библиотеки

Версия
1.16
1.15
1.14
1.13
1.12
1.11
1.8
1.7
1.6
1.5