From c74b52b4af1e54253ed1d9b16bef52afd128b2e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Kwiecin=CC=81ski?= Date: Sun, 19 May 2024 21:24:15 +0200 Subject: [PATCH 1/2] Update codestyle --- sample/app/src/main/kotlin/se/premex/gross/OssArtifactView.kt | 2 ++ sample/app/src/main/kotlin/se/premex/gross/ui/theme/Theme.kt | 1 + .../src/test/kotlin/io/github/usefulness/licensee/TestUtils.kt | 1 + 3 files changed, 4 insertions(+) diff --git a/sample/app/src/main/kotlin/se/premex/gross/OssArtifactView.kt b/sample/app/src/main/kotlin/se/premex/gross/OssArtifactView.kt index 57135d5..f313393 100644 --- a/sample/app/src/main/kotlin/se/premex/gross/OssArtifactView.kt +++ b/sample/app/src/main/kotlin/se/premex/gross/OssArtifactView.kt @@ -36,7 +36,9 @@ fun AssetsOssView() { when (val state = uiState.value) { State.Loading -> LoadingView(stringResource(id = R.string.loading)) + is State.Failed -> ErrorView(stringResource(id = R.string.error), state.errorMessage) + is State.Success -> { Column { Text( diff --git a/sample/app/src/main/kotlin/se/premex/gross/ui/theme/Theme.kt b/sample/app/src/main/kotlin/se/premex/gross/ui/theme/Theme.kt index 4c601da..59a812c 100644 --- a/sample/app/src/main/kotlin/se/premex/gross/ui/theme/Theme.kt +++ b/sample/app/src/main/kotlin/se/premex/gross/ui/theme/Theme.kt @@ -46,6 +46,7 @@ fun GrossTheme( } darkTheme -> DarkColorScheme + else -> LightColorScheme } diff --git a/sample/app/src/test/kotlin/io/github/usefulness/licensee/TestUtils.kt b/sample/app/src/test/kotlin/io/github/usefulness/licensee/TestUtils.kt index f06b760..89dc641 100644 --- a/sample/app/src/test/kotlin/io/github/usefulness/licensee/TestUtils.kt +++ b/sample/app/src/test/kotlin/io/github/usefulness/licensee/TestUtils.kt @@ -10,6 +10,7 @@ internal fun checkLoadedArtifacts(artifacts: List, isViewPager2Dependency @Suppress("KotlinConstantConditions") when (BuildConfig.BUILD_TYPE) { "release" -> assertThat(viewPagers).isEmpty() + "debug" -> assertThat(viewPagers.single().toString()).isEqualTo( Artifact( groupId = "androidx.viewpager2", From 0c9c0959f478c0b40ca701d3e7a372af0a6e4135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Kwiecin=CC=81ski?= Date: Sun, 19 May 2024 21:41:55 +0200 Subject: [PATCH 2/2] Fix failing build --- .github/workflows/default.yml | 36 +++++++++++++++++-- .../github/usefulness/licensee/TestUtils.kt | 6 ++-- sample/build.gradle | 3 +- 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml index 83d6ee1..fb23d2e 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/default.yml @@ -55,6 +55,37 @@ jobs: name: test-results-${{ matrix.os }} path: "${{ github.workspace }}/**/build/reports/tests" + build-sample: + runs-on: ubuntu-latest + name: Build sample app + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Write Gradle build properties to `~/.gradle/gradle.properties` + run: | + mkdir -p ~/.gradle + printf "org.gradle.jvmargs=-Xmx3G -XX:+UseParallelGC\n" >> ~/.gradle/gradle.properties + printf "org.gradle.vfs.watch=false\n" >> ~/.gradle/gradle.properties + shell: bash + + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 21 + + - uses: gradle/actions/setup-gradle@v3 + + - run: ./gradlew check + working-directory: sample + + - uses: actions/upload-artifact@v4 + if: ${{ always() }} + with: + name: sample-test-results-${{ matrix.os }} + path: "${{ github.workspace }}/**/build/reports/tests" + provide-agp-version-matrix: runs-on: ubuntu-latest outputs: @@ -98,9 +129,10 @@ jobs: - uses: gradle/actions/setup-gradle@v3 with: - build-root-directory: sample gradle-version: ${{ matrix.gradle }} - arguments: build -PagpVersion=${{ matrix.agp }} --continue + + - run: ./gradlew build -PagpVersion=${{ matrix.agp }} --continue + working-directory: sample - name: Upload reports if: ${{ failure() }} diff --git a/sample/app/src/test/kotlin/io/github/usefulness/licensee/TestUtils.kt b/sample/app/src/test/kotlin/io/github/usefulness/licensee/TestUtils.kt index 89dc641..2892ce8 100644 --- a/sample/app/src/test/kotlin/io/github/usefulness/licensee/TestUtils.kt +++ b/sample/app/src/test/kotlin/io/github/usefulness/licensee/TestUtils.kt @@ -15,8 +15,8 @@ internal fun checkLoadedArtifacts(artifacts: List, isViewPager2Dependency Artifact( groupId = "androidx.viewpager2", artifactId = "viewpager2", - version = "1.0.0", - name = "AndroidX Widget ViewPager2", + version = "1.1.0", + name = "ViewPager2", spdxLicenses = listOf( SpdxLicense( identifier = "Apache-2.0", @@ -24,7 +24,7 @@ internal fun checkLoadedArtifacts(artifacts: List, isViewPager2Dependency url = "https://www.apache.org/licenses/LICENSE-2.0", ), ), - scm = Scm(url = "http://source.android.com"), + scm = Scm(url = "https://cs.android.com/androidx/platform/frameworks/support"), unknownLicenses = emptyList(), ).toString(), ) diff --git a/sample/build.gradle b/sample/build.gradle index 150d5e6..9d1c27d 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -7,7 +7,7 @@ plugins { } commonConfig { - javaVersion = JavaVersion.VERSION_1_8 + javaVersion = JavaVersion.VERSION_11 } subprojects { @@ -19,5 +19,4 @@ subprojects { jvmTarget = "20" } } - }