Skip to content

Commit

Permalink
refactor(fixing version code issue)
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Palmqvist <[email protected]>
  • Loading branch information
coolusername244 and PalmN72 committed Oct 30, 2023
1 parent 3fdac9d commit a9fb802
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/skolplattformen-app-new/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ android {
applicationId "com.oppna_skolplattformen_new.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
// versionCode 1
versionCode 2
versionName "1.0"
}
signingConfigs {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<manifest android:versionCode="1" xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />

Expand Down
9 changes: 7 additions & 2 deletions apps/skolplattformen-app-new/android/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,20 @@ platform :android do
releaseNameSemVerArr = google_play_track_release_names(track: 'internal').max.split('.')
releaseNameSemVerArr[2] = (releaseNameSemVerArr.last.to_i + 1).to_s
ENV['VERSION_NAME'] = releaseNameSemVerArr.join('.')
ENV['GITTAGNAME'] = ENV['VERSION_NAME'].gsub(/\s+/, '').match(/\((.*?)\)/)[1] + '.' + releaseNameSemVerArr[2]
ENV['GITTAGNAME'] = ENV['VERSION_NAME'].gsub(/\s+/, '').match(/\((.*?)\)/)[1] + '.' + ENV['VERSION_CODE']
ENV['SUPPLY_VERSION_NAME'] = ENV['VERSION_NAME']
increment_version_code(
gradle_file_path: "../build.gradle",
)
versionFile = File.join(Dir.pwd, '..', 'version', 'version.properties').to_s
commandargs = "-n \"VERSION=#{ENV['VERSION_NAME']}\" > #{versionFile}".to_s
puts "echo #{commandargs}"
system("echo", commandargs)
else
ENV['VERSION_NAME'] = versionNameOverride
end
puts "Hello there - #{ENV['VERSION_NAME']}"
puts "Hello there - #{ENV['VERSION_CODE']}"
puts "Compiling #{ENV['VERSION_NAME']} (#{ENV['VERSION_CODE']}) "

# Dir.pwd when running through Fastlane is app/android/fastlane
Expand All @@ -48,7 +53,7 @@ platform :android do
"release",
"mapping.txt"
)

puts "Hello there - #{ENV['VERSION_CODE']}"

gradle(task: 'clean')
gradle(
Expand Down
5 changes: 5 additions & 0 deletions apps/skolplattformen-app-new/android/fastlane/Pluginfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Autogenerated by fastlane
#
# Ensure this file is checked in to source control!

gem 'fastlane-plugin-increment_version_code'

0 comments on commit a9fb802

Please sign in to comment.