Skip to content

Commit aaa9489

Browse files
authored
Merge pull request #10 from Tgo1014/feature/nstack
Feature/nstack
2 parents 70b59ed + 3f314e2 commit aaa9489

34 files changed

+361
-141
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@
1313
.externalNativeBuild
1414
.cxx
1515
local.properties
16+
17+
.idea/

.idea/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.idea/.name

Lines changed: 0 additions & 1 deletion
This file was deleted.

.idea/compiler.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.idea/gradle.xml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.idea/jarRepositories.xml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.idea/misc.xml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.idea/vcs.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

app/build.gradle

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@ plugins {
22
id 'com.android.application'
33
id 'kotlin-android'
44
id 'kotlin-kapt'
5-
id 'org.jetbrains.kotlin.plugin.serialization' version '1.4.20'
5+
id 'org.jetbrains.kotlin.plugin.serialization' version '1.4.21'
6+
id 'dk.nstack.translation.plugin'
7+
}
8+
9+
translation {
10+
appId = keys.appId
11+
apiKey = keys.apiKey
12+
acceptHeader = keys.acceptHeader
613
}
714

815
android {
@@ -17,6 +24,11 @@ android {
1724
versionCode 1
1825
versionName "1.0"
1926

27+
manifestPlaceholders = [
28+
appId : keys.appId,
29+
apiKey: keys.apiKey
30+
]
31+
2032
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2133
}
2234
buildFeatures {
@@ -34,7 +46,8 @@ android {
3446
dimension "default"
3547
applicationIdSuffix ".dev"
3648
manifestPlaceholders = [
37-
APP_NAME: "MonstarlabDev"
49+
APP_NAME: "MonstarlabDev",
50+
env : "staging"
3851
]
3952
buildConfigField "String", "API_URL", "\"https://reqres.in/api/\""
4053
}
@@ -43,7 +56,8 @@ android {
4356
applicationIdSuffix ".staging"
4457
//signingConfig signingConfigs.staging
4558
manifestPlaceholders = [
46-
APP_NAME: "MonstarlabStaging"
59+
APP_NAME: "MonstarlabStaging",
60+
env : "staging"
4761
]
4862
buildConfigField "String", "API_URL", "\"https://reqres.in/api/\""
4963
}
@@ -52,6 +66,7 @@ android {
5266
//signingConfig signingConfigs.production
5367
manifestPlaceholders = [
5468
APP_NAME: "Monstarlab",
69+
env : "production"
5570
]
5671
buildConfigField "String", "API_URL", "\"https://reqres.in/api/\""
5772
}
@@ -68,18 +83,17 @@ android {
6883

6984
dependencies {
7085

71-
implementation "org.jetbrains.kotlin:kotlin-stdlib:$versions.kotlin"
72-
def coroutinesVersion = "1.4.2"
86+
implementation ("org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}")
7387

74-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion"
75-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:$coroutinesVersion"
88+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:${versions.coroutines}"
89+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:${versions.coroutines}"
7690
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.0.1"
7791

7892
implementation 'androidx.core:core-ktx:1.3.2'
7993
implementation 'androidx.appcompat:appcompat:1.2.0'
8094
implementation 'com.google.android.material:material:1.2.1'
8195
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
82-
testImplementation 'junit:junit:4.+'
96+
testImplementation 'junit:junit:4.13.1'
8397
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
8498
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
8599

@@ -95,11 +109,14 @@ dependencies {
95109
implementation("androidx.navigation:navigation-fragment-ktx:2.3.2")
96110
implementation("androidx.navigation:navigation-ui-ktx:2.3.2")
97111

98-
def lifecycle = "2.2.0"
99-
implementation("androidx.lifecycle:lifecycle-livedata-core-ktx:$lifecycle")
100-
implementation("androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle")
101-
implementation("androidx.lifecycle:lifecycle-common-java8:$lifecycle")
102-
implementation("androidx.lifecycle:lifecycle-extensions:$lifecycle")
103-
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle")
104-
implementation("androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle")
112+
implementation("androidx.lifecycle:lifecycle-livedata-core-ktx:${versions.lifecycle}")
113+
implementation("androidx.lifecycle:lifecycle-runtime-ktx:${versions.lifecycle}")
114+
implementation("androidx.lifecycle:lifecycle-common-java8:${versions.lifecycle}")
115+
implementation("androidx.lifecycle:lifecycle-extensions:${versions.lifecycle}")
116+
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:${versions.lifecycle}")
117+
implementation("androidx.lifecycle:lifecycle-livedata-ktx:${versions.lifecycle}")
118+
119+
implementation "dk.nodes.nstack:nstack-kotlin:${versions.nodes_nstack_kotlin}"
120+
implementation "com.jakewharton.timber:timber:${versions.timber}"
121+
105122
}

app/src/main/AndroidManifest.xml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
34
package="com.monstarlab">
45

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

78
<application
9+
android:name=".App"
810
android:allowBackup="true"
911
android:icon="@mipmap/ic_launcher"
1012
android:label="@string/app_name"
11-
android:name=".App"
1213
android:roundIcon="@mipmap/ic_launcher_round"
1314
android:supportsRtl="true"
1415
android:theme="@style/Theme.Androidtemplate">
@@ -19,6 +20,22 @@
1920
<category android:name="android.intent.category.LAUNCHER" />
2021
</intent-filter>
2122
</activity>
23+
24+
<!-- nstack app id and key from build.gradle manifest placeholder -->
25+
<meta-data
26+
android:name="dk.nodes.nstack.appId"
27+
android:value="${appId}"
28+
tools:replace="android:value" />
29+
<meta-data
30+
android:name="dk.nodes.nstack.apiKey"
31+
android:value="${apiKey}"
32+
tools:replace="android:value" />
33+
34+
<meta-data
35+
android:name="dk.nodes.nstack.env"
36+
android:value="${env}"
37+
tools:replace="android:value" />
38+
2239
</application>
2340

2441
</manifest>

0 commit comments

Comments
 (0)