Module: GoNative::Commands::Android::Helpers::GradleVersionReader

Included in:
Publish, Version
Defined in:
lib/gonative/commands/android/helpers/gradle_version_reader.rb

Instance Method Summary collapse

Instance Method Details

#gradle_fileObject



8
9
10
# File 'lib/gonative/commands/android/helpers/gradle_version_reader.rb', line 8

def gradle_file
  @gradle_file ||= `find . -maxdepth 2 -iname build.gradle`.split("\n").first
end

#versionObject



12
13
14
15
16
17
# File 'lib/gonative/commands/android/helpers/gradle_version_reader.rb', line 12

def version
  return @version if @version

  str = IO.read(gradle_file)
  @version = str.match(/versionName\s+"(?<version>.+)"/)[:version]
end