Class: GitPivotalTrackerIntegration::VersionUpdate::Gradle

Inherits:
Object
  • Object
show all
Defined in:
lib/git-pivotal-tracker-integration/version-update/gradle.rb

Overview

A version updater for dealing with typical Gradle projects. This updater assumes that the version of the current project is stored within a gradle.properties file in the root of the repository. This properties file should have an entry with a key of version and version number as the key.

Instance Method Summary collapse

Constructor Details

#initialize(root) ⇒ Gradle

Creates an instance of this updater

Parameters:

  • root (String)

    The root of the repository



28
29
30
# File 'lib/git-pivotal-tracker-integration/version-update/gradle.rb', line 28

def initialize(root)
  @gradle_file = File.expand_path 'app/build.gradle', root
end

Instance Method Details

#update_dev_version(new_version) ⇒ void

This method returns an undefined value.

Update the version of the project

Parameters:

  • new_version (String)

    the version to update the project to



36
37
38
# File 'lib/git-pivotal-tracker-integration/version-update/gradle.rb', line 36

def update_dev_version(new_version)
  update_version_in_sec('DEV', new_version, 'SNAPSHOT')
end

#update_prod_version(new_version) ⇒ Object



48
49
50
# File 'lib/git-pivotal-tracker-integration/version-update/gradle.rb', line 48

def update_prod_version(new_version)
  update_version_in_sec('PROD', qa_version_code, new_version)
end

#update_qa_version(new_version) ⇒ Object



40
41
42
# File 'lib/git-pivotal-tracker-integration/version-update/gradle.rb', line 40

def update_qa_version(new_version)
  update_version_in_sec('QA', new_version, 'SNAPSHOT')
end

#update_uat_version(new_version) ⇒ Object



44
45
46
# File 'lib/git-pivotal-tracker-integration/version-update/gradle.rb', line 44

def update_uat_version(new_version)
  update_version_in_sec('UAT', qa_version_code, new_version)
end