Skip to content

Commit

Permalink
Bump Android SDK to 34 (gluonhq#1251)
Browse files Browse the repository at this point in the history
* Bump Android SDK to 34, gradle plugin to 8.5, NDK to 26, move package to namespace

* update copyright
  • Loading branch information
jperedadnr authored and johanvos committed Jul 13, 2024
1 parent e1d75ef commit c3313d3
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2023, Gluon
* Copyright (c) 2019, 2024, Gluon
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -66,7 +66,7 @@ public class AndroidTargetConfiguration extends PosixTargetConfiguration {

private static final String ANDROID_TRIPLET = new Triplet(Constants.Profile.ANDROID).toString();
private static final String ANDROID_MIN_SDK_VERSION = "21";
public static final String ANDROID_NDK_VERSION = "25.2.9519653";
public static final String ANDROID_NDK_VERSION = "26.3.11579264";
private static final List<String> ANDROID_KEYSTORE_EXTENSIONS = List.of(".keystore", ".jks");
private static final String WL_WHOLE_ARCHIVE = "-Wl,--whole-archive";
private static final String WL_NO_WHOLE_ARCHIVE = "-Wl,--no-whole-archive";
Expand Down Expand Up @@ -519,7 +519,9 @@ private Path prepareAndroidProject() throws IOException {
Files.deleteIfExists(Path.of(androidProject.toString(), "app", "src", "main", "java", "com", "gluonhq", "helloandroid", "NativeWebView.java"));
}
androidProject.resolve("gradlew").toFile().setExecutable(true);
FileOps.replaceInFile(androidProject.resolve("app").resolve("build.gradle"),
Path buildPath = androidProject.resolve("app").resolve("build.gradle");
FileOps.replaceInFile(buildPath, "namespace 'com.gluonhq.helloandroid'", "namespace '" + getAndroidPackageName() + "'");
FileOps.replaceInFile(buildPath,
"// OTHER_ANDROID_DEPENDENCIES", String.join("\n ", requiredDependencies()));
return androidProject;
}
Expand All @@ -546,7 +548,6 @@ private Path prepareAndroidManifest() throws IOException {

if (!Files.exists(userManifest)) {
// use default manifest
FileOps.replaceInFile(targetManifest, "package='com.gluonhq.helloandroid'", "package='" + getAndroidPackageName() + "'");
String newAppLabel = Objects.requireNonNullElse(releaseConfiguration.getAppLabel(), projectConfiguration.getAppName());
FileOps.replaceInFile(targetManifest, "A HelloGraal", newAppLabel);
String newVersionCode = releaseConfiguration.getVersionCode();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/gluonhq/substrate/util/FileDeps.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2023, Gluon
* Copyright (c) 2019, 2024, Gluon
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -72,7 +72,7 @@ public final class FileDeps {

private static final String ANDROID_KEY = "24333f8a63b6825ea9c5514f83c2829b004d1fee";
private static final String[] ANDROID_SDK_PACKAGES = {
"platforms;android-33", "build-tools;33.0.2", "platform-tools",
"platforms;android-34", "build-tools;34.0.0", "platform-tools",
"extras;android;m2repository", "extras;google;m2repository", "ndk;" + ANDROID_NDK_VERSION
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 33
namespace 'com.gluonhq.helloandroid'
compileSdkVersion 34

compileOptions {
sourceCompatibility 1.8
Expand All @@ -10,7 +11,7 @@ android {

defaultConfig {
minSdkVersion 21
targetSdkVersion 33
targetSdkVersion 34
}

repositories {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0'?>
<manifest xmlns:android='http://schemas.android.com/apk/res/android' package='com.gluonhq.helloandroid' android:versionCode='1' android:versionName='1.0'>
<manifest xmlns:android='http://schemas.android.com/apk/res/android' android:versionCode='1' android:versionName='1.0'>
<supports-screens android:xlargeScreens="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
<!-- PERMISSIONS -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath 'com.android.tools.build:gradle:8.5.0'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip

0 comments on commit c3313d3

Please sign in to comment.