Skip to content

Commit 8c2b0d9

Browse files
authored
Merge pull request #9 from Commencis/feature/sampleapp
Add Sample Application
2 parents 8c20f9b + 8635758 commit 8c2b0d9

49 files changed

Lines changed: 1240 additions & 11 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
uses: actions/setup-java@v3.11.0
2626
with:
2727
distribution: 'temurin'
28-
java-version: '11'
28+
java-version: '17'
2929
cache: gradle
3030

3131
- name: Grant execute permission for gradlew

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ jobs:
4242
env:
4343
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
4444
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
45-
run: ./gradlew -Dgradle.publish.key=$GRADLE_PUBLISH_KEY -Dgradle.publish.secret=$GRADLE_PUBLISH_SECRET publishPlugins
45+
run: ./gradlew -Dgradle.publish.key=$GRADLE_PUBLISH_KEY -Dgradle.publish.secret=$GRADLE_PUBLISH_SECRET :secretsvaultplugin:publishPlugins

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ captures/
3737
*.iml
3838
.idea/
3939

40-
# Keystore files
41-
*.jks
42-
4340
# External native build folder generated in Android Studio 2.2 and later
4441
.externalNativeBuild
4542

build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@ plugins {
33
alias(libs.plugins.gradle.publish).apply(false)
44
alias(libs.plugins.detekt).apply(false)
55
alias(libs.plugins.kotlin.serialization).apply(false)
6+
7+
// Sample App
8+
alias(libs.plugins.android.application).apply(false)
9+
alias(libs.plugins.kotlin.android).apply(false)
610
}

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
kotlin.code.style=official
2+
android.useAndroidX=true

gradle/libs.versions.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-
1616
detekt-formating = { group = "io.gitlab.arturbosch.detekt", name = "detekt-formatting", version.ref = "detekt" }
1717
detekt-rules = { group = "io.gitlab.arturbosch.detekt", name = "detekt-rules", version.ref = "detekt" }
1818

19+
# Sample App
20+
androidx-activityKtx = { module = "androidx.activity:activity-ktx", version = "1.7.2" }
21+
1922
[plugins]
23+
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
24+
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
2025
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
2126
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
2227
gradle-publish = { id = "com.gradle.plugin-publish", version.ref = "gradlePublish" }

sampleapp/build.gradle.kts

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
3+
plugins {
4+
alias(libs.plugins.android.application)
5+
alias(libs.plugins.kotlin.android)
6+
id("com.commencis.secretsvaultplugin")
7+
}
8+
9+
android {
10+
namespace = "com.commencis.secretsvaultplugin.sampleapp"
11+
compileSdk = 33
12+
13+
defaultConfig {
14+
applicationId = "com.commencis.secretsvaultplugin.sampleapp"
15+
minSdk = 21
16+
targetSdk = 33
17+
versionCode = 1
18+
versionName = "1.0"
19+
20+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
21+
}
22+
23+
signingConfigs {
24+
getByName("debug") {
25+
storeFile = file("keystore/debug.jks")
26+
storePassword = "android"
27+
keyAlias = "debug"
28+
keyPassword = "android"
29+
}
30+
create("release") {
31+
storeFile = file("keystore/release.jks")
32+
storePassword = "android"
33+
keyAlias = "release"
34+
keyPassword = "android"
35+
}
36+
}
37+
38+
buildTypes {
39+
debug {
40+
applicationIdSuffix = ".debug"
41+
signingConfig = signingConfigs.getByName("debug")
42+
}
43+
release {
44+
signingConfig = signingConfigs.getByName("release")
45+
isMinifyEnabled = true
46+
proguardFiles(
47+
getDefaultProguardFile("proguard-android-optimize.txt"),
48+
"proguard-rules.pro"
49+
)
50+
}
51+
}
52+
53+
compileOptions {
54+
sourceCompatibility = JavaVersion.VERSION_11
55+
targetCompatibility = JavaVersion.VERSION_11
56+
}
57+
58+
externalNativeBuild {
59+
cmake {
60+
path("src/main/cpp/CMakeLists.txt")
61+
}
62+
}
63+
64+
flavorDimensions.add("stage")
65+
productFlavors {
66+
create("dev") {
67+
dimension = "stage"
68+
externalNativeBuild {
69+
cmake {
70+
arguments("-DsourceSet=dev")
71+
}
72+
}
73+
}
74+
create("prod") {
75+
dimension = "stage"
76+
externalNativeBuild {
77+
cmake {
78+
arguments("-DsourceSet=prod")
79+
}
80+
}
81+
}
82+
}
83+
84+
kotlinOptions {
85+
jvmTarget = JvmTarget.JVM_11.target
86+
}
87+
}
88+
89+
secretsVault {
90+
appSignatures.set(
91+
listOf(
92+
"1A:92:D7:89:8F:16:C4:D3:46:E2:6D:C5:0C:2F:42:B0", // keystore/debug.kjs
93+
"45:4E:FD:58:87:C2:27:D2:5E:12:F4:C6:7F:CA:53:10", // keystore/release.kjs
94+
)
95+
)
96+
obfuscationKey.set("chEYKrGb5PJx0I09oa1mlEuXE5FxPjX2")
97+
cmake {
98+
version.set("3.17")
99+
}
100+
}
101+
102+
dependencies {
103+
implementation(libs.androidx.activityKtx)
104+
}

sampleapp/keystore/debug.jks

2.47 KB
Binary file not shown.

sampleapp/keystore/release.jks

2.49 KB
Binary file not shown.

sampleapp/secrets.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[
2+
{
3+
"key": "generalKey1",
4+
"value": "generalValue1"
5+
},
6+
{
7+
"key": "generalKey2",
8+
"value": "generalValue2"
9+
},
10+
{
11+
"key": "commonFlavorKey1",
12+
"value": "commonFlavorValue1Dev",
13+
"sourceSet": "dev"
14+
},
15+
{
16+
"key": "commonFlavorKey1",
17+
"value": "commonFlavorValue1Prod",
18+
"sourceSet": "prod"
19+
},
20+
{
21+
"key": "devOnlyKey1",
22+
"value": "devOnlyValue1",
23+
"sourceSet": "dev"
24+
},
25+
{
26+
"key": "prodOnlyKey1",
27+
"value": "prodOnlyValue1",
28+
"sourceSet": "prod"
29+
}
30+
]

0 commit comments

Comments
 (0)