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

Updates for JDK 21, update Actions #1082

Merged
merged 5 commits into from
Dec 6, 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
18 changes: 9 additions & 9 deletions .github/workflows/assemble-test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:

steps:
- name: Check out
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up JDK 17
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up JDK 21
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
java-version: '17'
java-version: '21'
distribution: 'temurin'
cache: gradle

Expand Down Expand Up @@ -53,11 +53,11 @@ jobs:

steps:
- name: Check out
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up JDK 17
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up JDK 21
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
java-version: '17'
java-version: '21'
distribution: 'temurin'
cache: gradle

Expand All @@ -73,7 +73,7 @@ jobs:
run: ./gradlew :app:lintAmazonRelease

- name: Upload lint reports
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: ${{ always() }} # also upload of lint errors
with:
name: Lint reports
Expand Down
5 changes: 5 additions & 0 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ val sgCompileSdk: Int by rootProject.extra
val sgMinSdk: Int by rootProject.extra
val sgTargetSdk: Int by rootProject.extra

tasks.withType(JavaCompile::class.java).configureEach {
// Suppress JDK 21 warning about deprecated, but not yet removed, source and target value 8 support
options.compilerArgs.add("-Xlint:-options")
}

android {
namespace = "com.battlelancer.seriesguide.api"
compileSdk = sgCompileSdk
Expand Down
13 changes: 10 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ val sgTargetSdk: Int by rootProject.extra
val sgVersionCode: Int by rootProject.extra
val sgVersionName: String by rootProject.extra

tasks.withType(JavaCompile::class.java).configureEach {
// Suppress JDK 21 warning about deprecated, but not yet removed, source and target value 8 support
options.compilerArgs.add("-Xlint:-options")
}

android {
namespace = "com.battlelancer.seriesguide"
compileSdk = sgCompileSdk
Expand Down Expand Up @@ -71,7 +76,8 @@ android {
jvmTarget = JavaVersion.VERSION_1_8.toString()
// Using experimental flatMapLatest for Paging 3
// Using experimental Material 3 compose APIs
freeCompilerArgs = freeCompilerArgs + "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi,androidx.compose.material3.ExperimentalMaterial3Api"
freeCompilerArgs =
freeCompilerArgs + "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi,androidx.compose.material3.ExperimentalMaterial3Api"
}

lint {
Expand All @@ -92,7 +98,8 @@ android {

productFlavors {
create("pure") {
isDefault = true // Make Studio select this by default, it often resets (after updates, randomly)
// Make Studio select this by default, it often resets (after updates, randomly)
isDefault = true

applicationId = "com.battlelancer.seriesguide"
versionCode = sgVersionCode
Expand Down Expand Up @@ -203,7 +210,7 @@ dependencies {
// Optional - Integration with activities
implementation(libs.androidx.activity.compose)
// Optional - Integration with ViewModels
implementation( libs.androidx.lifecycle.compose)
implementation(libs.androidx.lifecycle.compose)

// ViewModel and LiveData
implementation(libs.androidx.lifecycle.livedata)
Expand Down
5 changes: 5 additions & 0 deletions backend/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ plugins {
val sgCompileSdk: Int by rootProject.extra
val sgMinSdk: Int by rootProject.extra

tasks.withType(JavaCompile::class.java).configureEach {
// Suppress JDK 21 warning about deprecated, but not yet removed, source and target value 8 support
options.compilerArgs.add("-Xlint:-options")
}

android {
namespace = "com.uwetrottmann.seriesguide.backend"
compileSdk = sgCompileSdk
Expand Down
5 changes: 5 additions & 0 deletions billing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ plugins {
val sgCompileSdk: Int by rootProject.extra
val sgMinSdk: Int by rootProject.extra

tasks.withType(JavaCompile::class.java).configureEach {
// Suppress JDK 21 warning about deprecated, but not yet removed, source and target value 8 support
options.compilerArgs.add("-Xlint:-options")
}

android {
namespace = "com.uwetrottmann.seriesguide.billing"
compileSdk = sgCompileSdk
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ android.useAndroidX=true
# Do not turn on full mode for as long as possible: looking at unused.txt diff there are many
# differences with an increased risk of breaking things.
android.enableR8.fullMode=false

# JDK 21 still supports source and target value 8, it will be removed in a future release
android.javaCompile.suppressSourceTargetDeprecationWarning=true
5 changes: 5 additions & 0 deletions widgets/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ plugins {
val sgCompileSdk: Int by rootProject.extra
val sgMinSdk: Int by rootProject.extra

tasks.withType(JavaCompile::class.java).configureEach {
// Suppress JDK 21 warning about deprecated, but not yet removed, source and target value 8 support
options.compilerArgs.add("-Xlint:-options")
}

android {
namespace = "com.uwetrottmann.seriesguide.widgets"
compileSdk = sgCompileSdk
Expand Down
Loading