Skip to content

Commit bca39b1

Browse files
authored
Merge pull request #1094 from StoDevX/play-betas
Add Google Play betas
2 parents 46c6770 + 7eea906 commit bca39b1

File tree

21 files changed

+273
-28
lines changed

21 files changed

+273
-28
lines changed

.gitignore

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,22 @@ coverage
5252
# fastlane specific
5353
fastlane/report.xml
5454

55-
# deliver temporary files
56-
fastlane/Preview.html
55+
# deliver's temporary files
56+
Preview.html
5757

58-
# snapshot generated screenshots
58+
# snapshot's generated screenshots
5959
fastlane/screenshots
6060

61-
# scan temporary files
61+
# scan's temporary files
6262
fastlane/test_output
6363

6464
# deploy key
6565
scripts/travisci_deploy_key
66+
fastlane/play-private-key.json
6667

6768
# generated files
6869
docs/
70+
71+
# android keystores
72+
android/app/signing.properties
73+
*.keystore

android/app/build.gradle

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"
8181
* Upload all the APKs to the Play Store and people will download
8282
* the correct one based on the CPU architecture of their device.
8383
*/
84-
def enableSeparateBuildPerCPUArchitecture = false
84+
def enableSeparateBuildPerCPUArchitecture = true
8585

8686
/**
8787
* Run Proguard to shrink the Java bytecode in release builds.
@@ -95,8 +95,8 @@ android {
9595
defaultConfig {
9696
applicationId "com.allaboutolaf"
9797
minSdkVersion 16
98-
targetSdkVersion 25
99-
versionCode 1
98+
targetSdkVersion 23
99+
versionCode 5
100100
versionName "2.2.3"
101101
ndk {
102102
abiFilters "armeabi-v7a", "x86"
@@ -108,6 +108,10 @@ android {
108108
gmaps_key: System.getenv("GMAPS_KEY") ?: "",
109109
]
110110
}
111+
signingConfigs {
112+
// the signingConfig is configured below
113+
release
114+
}
111115
splits {
112116
abi {
113117
reset()
@@ -120,6 +124,7 @@ android {
120124
release {
121125
minifyEnabled enableProguardInReleaseBuilds
122126
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
127+
signingConfig signingConfigs.release
123128
}
124129
}
125130
// applicationVariants are e.g. debug, release
@@ -143,6 +148,40 @@ android {
143148
}
144149
}
145150

151+
// borrowed from https://gist.github.com/gabrielemariotti/6856974
152+
def propFile = new File('android/app//signing.properties')
153+
if (propFile.canRead()) {
154+
def Properties props = new Properties()
155+
props.load(new FileInputStream(propFile))
156+
if (props != null
157+
&& props.containsKey('STORE_FILE')
158+
&& props.containsKey('STORE_PASSWORD')
159+
&& props.containsKey('KEY_ALIAS')
160+
&& props.containsKey('KEY_PASSWORD')
161+
) {
162+
logger.info 'android/app/signing.properties is fully functional.'
163+
android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
164+
android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
165+
android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
166+
android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
167+
} else {
168+
println 'android/app/signing.properties found, but some entries are missing.'
169+
if (props == null) {
170+
logger.warn '`props` was null'
171+
} else {
172+
logger.warn "has STORE_FILE: ${props.containsKey('STORE_FILE')}"
173+
logger.warn "has STORE_PASSWORD: ${props.containsKey('STORE_PASSWORD')}"
174+
logger.warn "has KEY_ALIAS: ${props.containsKey('KEY_ALIAS')}"
175+
logger.warn "has KEY_PASSWORD: ${props.containsKey('KEY_PASSWORD')}"
176+
}
177+
android.buildTypes.release.signingConfig = null
178+
}
179+
} else {
180+
logger.warn 'android/app/signing.properties not found.'
181+
logger.warn "cwd: ${new File(".").absolutePath}"
182+
android.buildTypes.release.signingConfig = null
183+
}
184+
146185
dependencies {
147186
// please keep this list sorted
148187
compile project(':bugsnag-react-native')

android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ org.gradle.jvmargs=-Xmx1536m
1616
# When configured, Gradle will run in incubating parallel mode.
1717
# This option should only be used with decoupled projects. More details, visit
1818
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
19-
# org.gradle.parallel=true
19+
org.gradle.parallel=true
2020

2121
android.useDeprecatedNdk=true

fastlane/Appfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@ app_identifier 'NFMTHAZVS9.com.drewvolz.stolaf'
44
# Your Apple email address
55
66

7-
# you can even provide different app identifiers, Apple IDs and team names per lane:
8-
# More information: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Appfile.md
7+
# This is a private key. It is not included in the repository.
8+
# Contact [email protected] or another admin if you need access.
9+
json_key_file 'fastlane/play-private-key.json'
10+
package_name 'com.allaboutolaf'

fastlane/Fastfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# Set a minimum version for fastlane
77
fastlane_version '2.19.0'
88

9+
require 'fileutils'
10+
911
import 'lib/before_all.rb'
1012
import 'lib/util.rb'
1113

fastlane/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ Build the release notes: branch, commit hash, changelog
4949
fastlane bundle_data
5050
```
5151
run `npm run bundle-data`
52+
### keys
53+
```
54+
fastlane keys
55+
```
56+
Set up the private keys + environment variables for local development
5257

5358
----
5459

@@ -78,6 +83,11 @@ Include the build number in the version string
7883
fastlane android codepush
7984
```
8085

86+
### android matchesque
87+
```
88+
fastlane android matchesque
89+
```
90+
extract the android keys from the match repo
8191

8292
----
8393

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
module Fastlane
2+
module Actions
3+
class GetGradleVersionCodeAction < Action
4+
def self.run(params)
5+
gradle_path = params[:gradle_path]
6+
version_code = nil
7+
8+
File.foreach(gradle_path) do |line|
9+
if line.include? 'versionCode '
10+
components = line.strip.split(' ')
11+
version_code = components[1].tr('"', '')
12+
end
13+
end
14+
15+
if version_code.nil?
16+
UI.user_error! "Could not find the version code in #{gradle_path}"
17+
else
18+
UI.success "Version code: #{version_code}"
19+
end
20+
21+
version_code.to_i
22+
end
23+
24+
def self.description
25+
'Get the version code of your android project.'
26+
end
27+
28+
def self.authors
29+
['Hawken Rives']
30+
end
31+
32+
def self.available_options
33+
[
34+
FastlaneCore::ConfigItem.new(key: :gradle_path,
35+
description: 'The path to the build.gradle file',
36+
type: String),
37+
]
38+
end
39+
40+
def self.is_supported?(platform)
41+
[:android].include?(platform)
42+
end
43+
end
44+
end
45+
end

fastlane/actions/set_gradle_version_code.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ def self.available_options
4747
FastlaneCore::ConfigItem.new(key: :gradle_path,
4848
description: 'The path to the build.gradle file'),
4949
FastlaneCore::ConfigItem.new(key: :version_code,
50-
description: 'The version to change to'),
50+
description: 'The version to change to',
51+
type: Integer),
5152
]
5253
end
5354

fastlane/lib/util.rb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,21 @@ def authorize_ci_for_keys
99
end
1010
end
1111

12-
# Get the commit of the latest build on HockeyApp
13-
def hockeyapp_version_commit
14-
latest_hockeyapp_notes[:commit_hash]
15-
end
16-
1712
# Gets the version, either from Travis or from Hockey
1813
def current_build_number
1914
if ENV.key?('TRAVIS_BUILD_NUMBER')
2015
return ENV['TRAVIS_BUILD_NUMBER']
2116
end
2217

2318
begin
24-
(latest_testflight_build_number + 1).to_s
19+
case lane_context[:PLATFORM_NAME]
20+
when :android
21+
UI.input "Please enter a build number: "
22+
when :ios
23+
(latest_testflight_build_number + 1).to_s
24+
else
25+
UI.input "Please enter a build number: "
26+
end
2527
rescue
2628
'1'
2729
end
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
We can't wait to show you what we've been up to!
2+
3+
In this version:
4+
- You can reorder the home screen now!
5+
- Check out the Northfield events calendar!
6+
- Discover new student orgs to join!
7+
- Meals Remaining in SIS is back!
8+
- Hours redesign! More buildings! More hours!
9+
- Menus redesign! Better menus! Faster loading!
10+
- There's a new FAQs section in Settings! Check it out.
11+
- The Pause Events calendar is now included!
12+
- Numerous Bug Fixes

0 commit comments

Comments
 (0)