From: Adeel Kazmi Date: Tue, 5 Sep 2023 12:10:07 +0000 (+0100) Subject: Update the Android build to use the latest toolset X-Git-Tag: dali_2.2.43~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-demo.git;a=commitdiff_plain;h=8e29abd39cc63e6643f17df7c3e13755f7f32d52 Update the Android build to use the latest toolset Change-Id: Ic7933e0289a15fec3cc8668f7a2a04514c5c87d9 --- diff --git a/README.md b/README.md index ec9bad2..a5993fc 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,8 @@ * [NON-SMACK Targets](#non-smack-targets) * [SMACK enabled Targets](#smack-enabled-targets) * [DEBUG Builds](#debug-builds-1) - * [3. Building for Android](#3-android-builds) - * [4. Building for MS Windows](#4-windows-builds) + * [3. Building for Android](#3-building-for-android) + * [4. Building for MS Windows](#4-building-for-ms-windows) * [Build with the Visual Studio project](#build-with-the-visual-studio-project) * [Build with CMake](#build-with-cmake) * [5. Building for MacOS](#5-building-for-macos) @@ -85,7 +85,8 @@ You can set the sample's name and can build that sample only. For example, If yo ### Requirements - - Ubuntu 16.04 or later + - Ubuntu 20.04 or later + - Open JDK Version 17 or above - Android DALi dependencies - If you are behind a proxy, please set up the "http_proxy" and "https_proxy" environment variables appropriately - Clone dali-core, dali-adaptor, dali-toolkit & android-dependencies to the same folder as dali-demo @@ -211,4 +212,4 @@ To build, run: - Add 2 lines to `shared/dali-demo-strings.h` for the title of your application, please keep in alphabetic order, - Add as many translations of the title as possible to the files in `resources/po`. Currently, this only works on Ubuntu. - In each example folder, create a README.md with images and a description of what the example is demonstrating. - Look at [this](examples/particle-system/README.md) for reference. \ No newline at end of file + Look at [this](examples/particle-system/README.md) for reference. diff --git a/build/android/app/build.gradle b/build/android/app/build.gradle index c7ee2a1..5eba98b 100644 --- a/build/android/app/build.gradle +++ b/build/android/app/build.gradle @@ -8,6 +8,7 @@ def daliEnvLibDir = daliEnvDir + '/lib' def daliEnvFilesDir = daliEnvDir + '/files' android { + namespace = "com.sec.dalidemo" signingConfigs { config { storeFile file("../key.jks") @@ -30,7 +31,6 @@ android { } } } - project.archivesBaseName = 'dali-demo' aaptOptions { noCompress '' } @@ -81,8 +81,8 @@ android { } } compileOptions { - targetCompatibility = 1.6 - sourceCompatibility = 1.6 + targetCompatibility = 1.8 + sourceCompatibility = 1.8 } } @@ -114,6 +114,11 @@ task cleanDali(type:Exec) { commandLine 'sh', './build.sh', 'clean' } + +tasks.withType(JavaCompile) { + options.deprecation = true +} + buildDali.dependsOn buildDaliDependencies preBuild.dependsOn buildDali diff --git a/build/android/app/src/main/AndroidManifest.xml b/build/android/app/src/main/AndroidManifest.xml index e10568e..ae3b287 100644 --- a/build/android/app/src/main/AndroidManifest.xml +++ b/build/android/app/src/main/AndroidManifest.xml @@ -1,7 +1,6 @@ diff --git a/build/android/build.gradle b/build/android/build.gradle index 5b10372..4ab2c58 100644 --- a/build/android/build.gradle +++ b/build/android/build.gradle @@ -2,17 +2,17 @@ buildscript { repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.2' + classpath 'com.android.tools.build:gradle:8.1.0' } } allprojects { repositories { google() - jcenter() + mavenCentral() } } @@ -21,6 +21,8 @@ task clean(type: Delete) { } - +tasks.withType(JavaCompile) { + options.deprecation = true +} diff --git a/build/android/build.sh b/build/android/build.sh index 7d2b9c0..3140335 100755 --- a/build/android/build.sh +++ b/build/android/build.sh @@ -25,10 +25,18 @@ if [ ! -d "$ANDROID_SDK" ]; then if [ ! -d "$ROOT_DIR/Android/Sdk" ]; then mkdir -p "$ROOT_DIR/Android/Sdk" cd "$ROOT_DIR/Android/Sdk" - wget --quiet https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip - unzip -q sdk-tools-linux-4333796.zip - tools/bin/sdkmanager --update $SdbProxyOptions - yes | tools/bin/sdkmanager $SdbProxyOptions "patcher;v4" "platform-tools" "platforms;android-29" "build-tools;29.0.2" "cmake;3.10.2.4988404" "ndk-bundle" "ndk;22.1.7171670" + wget --quiet https://developer.android.com/studio/index.html + if [ ! -f index.html ]; then echo ERROR: Unable to get Android Tools Version; exit 1; fi + + androidCommandLineToolsPkgUrl=$(cat index.html | grep "commandlinetools-linux-" | grep href | cut -d\" -f 2) + androidCommandLineToolsPkgName=$(echo $androidCommandLineToolsPkgUrl | rev | cut -d\/ -f 1 | rev) + echo "Downloading Android Command Line Tools from: $androidCommandLineToolsPkgUrl" + wget --quiet $androidCommandLineToolsPkgUrl + echo "Unzipping $androidCommandLineToolsPkgName" + unzip -q $androidCommandLineToolsPkgName + SDK_MANAGER="$ROOT_DIR/Android/Sdk/cmdline-tools/bin/sdkmanager --sdk_root=$ROOT_DIR/Android/Sdk $SdbProxyOptions" + $SDK_MANAGER --update + yes | $SDK_MANAGER "patcher;v4" "platform-tools" "platforms;android-29" "build-tools;29.0.2" "cmake;3.10.2.4988404" "ndk-bundle" "ndk;22.1.7171670" cd - fi fi @@ -53,11 +61,12 @@ if [ ! -d "$ANDROID_NDK" ]; then fi fi -if [ ! -d "$ROOT_DIR/gradle/gradle-5.4.1" ]; then +GRADLE_VERSION=8.3 +if [ ! -d "$ROOT_DIR/gradle/gradle-$GRADLE_VERSION" ]; then mkdir -p $ROOT_DIR/gradle cd $ROOT_DIR/gradle - wget --quiet https://services.gradle.org/distributions/gradle-5.4.1-bin.zip - unzip -q gradle-5.4.1-bin.zip + wget --quiet https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip + unzip -q gradle-$GRADLE_VERSION-bin.zip cd - fi @@ -65,6 +74,7 @@ GRADLE_PROPERTIES_FILE=gradle.properties if [ ! -f $GRADLE_PROPERTIES_FILE ] then echo "org.gradle.jvmargs=-Xmx1536m" > $GRADLE_PROPERTIES_FILE + echo "android.useAndroidX=true" >> $GRADLE_PROPERTIES_FILE if [ ! -z $http_proxy ] then echo "systemProp.http.proxyHost=$proxyHost" >> $GRADLE_PROPERTIES_FILE @@ -72,7 +82,9 @@ then if [ ! -z $https_proxy ] then - httpsProxyFull=${https_proxy/https:\/\/} + httpsProxyFull=$https_proxy + httpsProxyFull=${httpsProxyFull/https:\/\/} + httpsProxyFull=${httpsProxyFull/http:\/\/} httpsProxyHost=$(echo $httpsProxyFull | cut -d: -f 1) httpsProxyPort=$(echo $httpsProxyFull | cut -d: -f 2) echo "systemProp.https.proxyHost=$httpsProxyHost" >> $GRADLE_PROPERTIES_FILE @@ -81,10 +93,10 @@ then fi fi -export PATH=$PATH:$ROOT_DIR/gradle/gradle-5.4.1/bin +export PATH=$PATH:$ROOT_DIR/gradle/gradle-$GRADLE_VERSION/bin [ ! -f local.properties ] && echo 'sdk.dir='$(echo $ANDROID_SDK) > local.properties -gradle wrapper +gradle wrapper || exit 1 if [ "$1" = "clean" ]; then ./gradlew clean else