Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update codestyle #146

Merged
merged 2 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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() }}
Expand Down
2 changes: 2 additions & 0 deletions sample/app/src/main/kotlin/se/premex/gross/OssArtifactView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ fun GrossTheme(
}

darkTheme -> DarkColorScheme

else -> LightColorScheme
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@ internal fun <T> checkLoadedArtifacts(artifacts: List<T>, isViewPager2Dependency
@Suppress("KotlinConstantConditions")
when (BuildConfig.BUILD_TYPE) {
"release" -> assertThat(viewPagers).isEmpty()

"debug" -> assertThat(viewPagers.single().toString()).isEqualTo(
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",
name = "Apache License 2.0",
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(),
)
Expand Down
3 changes: 1 addition & 2 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

commonConfig {
javaVersion = JavaVersion.VERSION_1_8
javaVersion = JavaVersion.VERSION_11
}

subprojects {
Expand All @@ -19,5 +19,4 @@ subprojects {
jvmTarget = "20"
}
}

}
Loading