Skip to content

Commit ebb1895

Browse files
committed
Let an example project use distributed artifacts on local
1 parent 11248cd commit ebb1895

File tree

9 files changed

+35
-7
lines changed

9 files changed

+35
-7
lines changed

.circleci/config.yml

+15-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ jobs:
5555
paths:
5656
- repository
5757

58+
schema_test:
59+
executor: android
60+
steps:
61+
- setup_workspace
62+
- restore_gradle_cache:
63+
cache_name: example
64+
- attach_workspace:
65+
at: ~/.m2
66+
- run: ./gradlew assembleYellowBlueRelease # it's okay if succeed
67+
5868
acceptance_test:
5969
executor: android
6070
steps:
@@ -155,7 +165,8 @@ jobs:
155165
fi
156166
157167
git checkout -- app
158-
- run: ./gradlew visualizeLicenseList
168+
- run: ./gradlew visualizeLicenseList -PvisualizationFormat=html
169+
- run: ./gradlew visualizeLicenseList -PvisualizationFormat=json
159170
- store_artifacts:
160171
path: app/src/yellowBlueRelease/assets
161172
destination: assets
@@ -171,3 +182,6 @@ workflows:
171182
- acceptance_test:
172183
requires:
173184
- install_plugin_jars
185+
- schema_test:
186+
requires:
187+
- install_plugin_jars

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ release:
4545
- key: activity
4646
displayName: Activity
4747
url: https://developer.android.com/jetpack/androidx
48-
copyrightHolders: []
48+
copyrightHolders:
49+
- The Android Open Source Project
4950
licenses:
5051
- apache-2.0
5152
```

assets/recyclerViewSample.png

-12.1 KB
Loading

assets/webViewSample.png

-9.6 KB
Loading

example/app/build.gradle.kts

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ android {
3636
getByName("release") {
3737
isMinifyEnabled = false
3838
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
39+
signingConfig = signingConfigs.getByName("debug")
3940
}
4041
}
4142

@@ -110,7 +111,7 @@ licenseList {
110111

111112
visualization {
112113
// it's useful for those who want to customize the appearance of the license viewer
113-
format = "html"
114+
format = properties["visualizationFormat"] as? String ?: "html"
114115
}
115116
}
116117
}

example/app/src/main/assets/license-list.html

-1
This file was deleted.

example/app/src/main/assets/license-list.json

-1
This file was deleted.

example/app/src/main/java/io/github/jmatsu/license/example/poko/ArtifactDifinitionPoko.kt

+9-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,12 @@ import com.squareup.moshi.JsonClass
44
import io.github.jmatsu.license.schema.ArtifactDefinition
55

66
@JsonClass(generateAdapter = true)
7-
class ArtifactDifinitionPoko(override val copyrightHolders: List<String>, override val displayName: String, override val key: String, override val licenses: List<PlainLicensePoko>, override val url: String?) : ArtifactDefinition<PlainLicensePoko>
7+
class ArtifactDifinitionPoko(
8+
override val copyrightHolders: List<String>,
9+
override val displayName: String,
10+
override val key: String,
11+
override val licenses: List<PlainLicensePoko>,
12+
override val url: String?,
13+
override val keep: Boolean = true
14+
) : ArtifactDefinition<PlainLicensePoko> {
15+
}

example/build.gradle.kts

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@ buildscript {
22
repositories {
33
google()
44
jcenter()
5-
mavenLocal()
5+
if (System.getenv("CI") == "true") {
6+
mavenLocal()
7+
} else {
8+
maven {
9+
url = uri("https://plugins.gradle.org/m2/")
10+
}
11+
}
612
}
713
dependencies {
814
classpath("com.android.tools.build:gradle:3.6.1")

0 commit comments

Comments
 (0)