Git Product home page Git Product logo

gradle-step-release-plugin's Introduction

gradle-step-release-plugin

Gradle plugin to launch custom and gradle task in sequential order

Download

Download and Usage

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath "com.tgirard12:gradle-step-release-plugin:VERSION"
    }
}

apply plugin: "com.tgirard12.gradle-step-release-plugin"

releaseStep {

    githubGroup = "tgirard12"
    githubProject = "gradle-step-release-plugin"

    def gradleFile = "gradle.properties"
    def props = ["project_version"]

    def releaseVersion = setProperties(props, gradleFile)

    steps = [message { "Releasing a new version" },

             gitCheckChanges(),
             gitCheckBranch { "master" },
             
             // Set new Release version
             releaseVersion,
             checkProperties(props, gradleFile),

             // Commit and create release version
             gitAdd { [gradleFile] },
             gitCommit { "v" + releaseVersion.stepResult },

             task(":clean"),
             task(":test"),

             // Publish on bintray
             task(":bintrayUpload"),
             question {
                 "Publish artifact on jcenter ? \n\n" +
                         "https://bintray.com/tgirard12/kotlin/gradle-step-release-plugin ?"
             },

             gitPush("origin", "master"),

             githubRelease(),
             githubMilestone(),

             message { "Release v" + releaseVersion.stepResult + " OK :-)" }
    ]
}

Available Options

Simple step

  • message { "Simple message" }
  • question { "Release a new version ?" }
  • read { "Read a value" }: String
  • step { println("Custom step") }

Gradle task step

  • task(":clean")
  • task(":project:build")

Properties files

  • checkProperties(propsKeys: List<String>, propFile: String = gradle.properties)

    • Show properties in a file
    • propsKeys : Properties list to show
    • propFile : Properties file
  • setProperties(propsKeys: List<String>, propFile: String = gradle.properties)

    • Modify properties in propFile without modify the order of any line
    • propsKeys : Properties list to modify
    • propFile : Properties file

Git Step

  • gitCheckout { "branch" }
  • gitAdd { ["files"] }
  • gitCommit { "message" }
  • gitMerge("origin", "master")
  • gitPull("origin", "master")
  • gitPush("origin", "master")
  • gitTag { "name" } message: String? = null)
  • gitCheckChanges() : Check if the repository is clean
  • gitCheckBranch() : Check the current branch

GitHub Step

GitHub properties must be set :

  • githubUrl: String = "https://github.com"
  • githubGroup: String
  • githubProject: String

Open Github Web UI :

  • githubPullRequest("sourceBranch", "targetBranch")
    • Create Pull request
  • githubRelease()
    • Create new release
  • githubMilestone()
    • Create new Milestone

GitLab Step

Gitlab properties must be set :

  • gitlabUrl: String = "https://gitlab.com"
  • gitlabGroup: String?
  • gitlabProject: String?

Open GitLab Web UI :

  • gitlabMergeRequest("sourceBranch", "targetBranch")
    • Create Merge request
  • gitlabTag( { "tagName" }, "branch")
    • Create new tag
  • gitlabMilestone()
    • Create new Milestone

gradle-step-release-plugin's People

Contributors

tgirard12 avatar

Watchers

 avatar  avatar

gradle-step-release-plugin's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.