diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 57bd914..4862042 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 with: distribution: temurin - java-version: 11 + java-version: 17 cache: 'gradle' - name: Grant execute permission for gradlew diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index fb4ce39..c905b9b 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -41,7 +41,7 @@ jobs: uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 with: distribution: temurin - java-version: 11 + java-version: 17 cache: 'gradle' - name: Grant execute permission for gradlew diff --git a/app/build.gradle b/app/build.gradle index ac4ee86..e557668 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,11 +1,14 @@ -apply plugin: 'com.android.application' +plugins { + id 'com.android.application' +} android { - compileSdkVersion(33) + namespace "com.launchdarkly.hello_android" + compileSdk 34 defaultConfig { applicationId "com.launchdarkly.hello_android" - minSdkVersion(21) - targetSdkVersion(33) + minSdkVersion(24) + targetSdkVersion(34) versionCode 1 versionName "1.0" } @@ -16,12 +19,12 @@ android { } } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } } dependencies { implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'com.launchdarkly:launchdarkly-android-client-sdk:4.2.2' + implementation 'com.launchdarkly:launchdarkly-android-client-sdk:5.11.0' } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3e9fb21..760d71d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - + - \ No newline at end of file + diff --git a/app/src/main/java/com/launchdarkly/hello_android/MainApplication.java b/app/src/main/java/com/launchdarkly/hello_android/MainApplication.java index 1119ed8..8bdb5f5 100644 --- a/app/src/main/java/com/launchdarkly/hello_android/MainApplication.java +++ b/app/src/main/java/com/launchdarkly/hello_android/MainApplication.java @@ -6,6 +6,7 @@ import com.launchdarkly.sdk.LDContext; import com.launchdarkly.sdk.android.LDClient; import com.launchdarkly.sdk.android.LDConfig; +import com.launchdarkly.sdk.android.LDConfig.Builder.AutoEnvAttributes; public class MainApplication extends Application { @@ -18,7 +19,9 @@ public void onCreate() { // Set LAUNCHDARKLY_MOBILE_KEY to your LaunchDarkly mobile key found on the LaunchDarkly // dashboard in the start guide. - LDConfig ldConfig = new LDConfig.Builder() + // If you want to disable the Auto EnvironmentAttributes functionality, + // use AutoEnvAttributes.Disabled as the argument to the Builder. + LDConfig ldConfig = new LDConfig.Builder(AutoEnvAttributes.Enabled) .mobileKey(LAUNCHDARKLY_MOBILE_KEY) .build(); diff --git a/build.gradle b/build.gradle index 9f4fade..5e9cadd 100644 --- a/build.gradle +++ b/build.gradle @@ -1,28 +1,4 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:4.1.3' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - mavenLocal() - // Before LaunchDarkly release artifacts get synced to Maven Central they are here along with snapshots: - maven { url = uri("https://oss.sonatype.org/content/groups/public/") } - google() - mavenCentral() - } -} - -task clean(type: Delete) { - delete rootProject.buildDir +plugins { + id 'com.android.application' version '8.7.0' apply false } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 28eec68..94bfeb9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip diff --git a/settings.gradle b/settings.gradle index e7b4def..4850079 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,19 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + mavenLocal() + // Before LaunchDarkly release artifacts get synced to Maven Central they are here along with snapshots: + maven { url = uri("https://oss.sonatype.org/content/groups/public/") } + } +} +rootProject.name = "hello-android-java" include ':app'