Commit 8e29abd39cc63e6643f17df7c3e13755f7f32d52

Authored by Adeel Kazmi
1 parent 3d3d3516

Update the Android build to use the latest toolset

Change-Id: Ic7933e0289a15fec3cc8668f7a2a04514c5c87d9
README.md
@@ -11,8 +11,8 @@ @@ -11,8 +11,8 @@
11 * [NON-SMACK Targets](#non-smack-targets) 11 * [NON-SMACK Targets](#non-smack-targets)
12 * [SMACK enabled Targets](#smack-enabled-targets) 12 * [SMACK enabled Targets](#smack-enabled-targets)
13 * [DEBUG Builds](#debug-builds-1) 13 * [DEBUG Builds](#debug-builds-1)
14 - * [3. Building for Android](#3-android-builds)  
15 - * [4. Building for MS Windows](#4-windows-builds) 14 + * [3. Building for Android](#3-building-for-android)
  15 + * [4. Building for MS Windows](#4-building-for-ms-windows)
16 * [Build with the Visual Studio project](#build-with-the-visual-studio-project) 16 * [Build with the Visual Studio project](#build-with-the-visual-studio-project)
17 * [Build with CMake](#build-with-cmake) 17 * [Build with CMake](#build-with-cmake)
18 * [5. Building for MacOS](#5-building-for-macos) 18 * [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 @@ -85,7 +85,8 @@ You can set the sample's name and can build that sample only. For example, If yo
85 85
86 ### Requirements 86 ### Requirements
87 87
88 - - Ubuntu 16.04 or later 88 + - Ubuntu 20.04 or later
  89 + - Open JDK Version 17 or above
89 - Android DALi dependencies 90 - Android DALi dependencies
90 - If you are behind a proxy, please set up the "http_proxy" and "https_proxy" environment variables appropriately 91 - If you are behind a proxy, please set up the "http_proxy" and "https_proxy" environment variables appropriately
91 - Clone dali-core, dali-adaptor, dali-toolkit & android-dependencies to the same folder as dali-demo 92 - Clone dali-core, dali-adaptor, dali-toolkit & android-dependencies to the same folder as dali-demo
@@ -211,4 +212,4 @@ To build, run: @@ -211,4 +212,4 @@ To build, run:
211 - Add 2 lines to `shared/dali-demo-strings.h` for the title of your application, please keep in alphabetic order, 212 - Add 2 lines to `shared/dali-demo-strings.h` for the title of your application, please keep in alphabetic order,
212 - Add as many translations of the title as possible to the files in `resources/po`. Currently, this only works on Ubuntu. 213 - Add as many translations of the title as possible to the files in `resources/po`. Currently, this only works on Ubuntu.
213 - In each example folder, create a README.md with images and a description of what the example is demonstrating. 214 - In each example folder, create a README.md with images and a description of what the example is demonstrating.
214 - Look at [this](examples/particle-system/README.md) for reference.  
215 \ No newline at end of file 215 \ No newline at end of file
  216 + Look at [this](examples/particle-system/README.md) for reference.
build/android/app/build.gradle
@@ -8,6 +8,7 @@ def daliEnvLibDir = daliEnvDir + '/lib' @@ -8,6 +8,7 @@ def daliEnvLibDir = daliEnvDir + '/lib'
8 def daliEnvFilesDir = daliEnvDir + '/files' 8 def daliEnvFilesDir = daliEnvDir + '/files'
9 9
10 android { 10 android {
  11 + namespace = "com.sec.dalidemo"
11 signingConfigs { 12 signingConfigs {
12 config { 13 config {
13 storeFile file("../key.jks") 14 storeFile file("../key.jks")
@@ -30,7 +31,6 @@ android { @@ -30,7 +31,6 @@ android {
30 } 31 }
31 } 32 }
32 } 33 }
33 - project.archivesBaseName = 'dali-demo'  
34 aaptOptions { 34 aaptOptions {
35 noCompress '' 35 noCompress ''
36 } 36 }
@@ -81,8 +81,8 @@ android { @@ -81,8 +81,8 @@ android {
81 } 81 }
82 } 82 }
83 compileOptions { 83 compileOptions {
84 - targetCompatibility = 1.6  
85 - sourceCompatibility = 1.6 84 + targetCompatibility = 1.8
  85 + sourceCompatibility = 1.8
86 } 86 }
87 } 87 }
88 88
@@ -114,6 +114,11 @@ task cleanDali(type:Exec) { @@ -114,6 +114,11 @@ task cleanDali(type:Exec) {
114 commandLine 'sh', './build.sh', 'clean' 114 commandLine 'sh', './build.sh', 'clean'
115 } 115 }
116 116
  117 +
  118 +tasks.withType(JavaCompile) {
  119 + options.deprecation = true
  120 +}
  121 +
117 buildDali.dependsOn buildDaliDependencies 122 buildDali.dependsOn buildDaliDependencies
118 preBuild.dependsOn buildDali 123 preBuild.dependsOn buildDali
119 124
build/android/app/src/main/AndroidManifest.xml
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <!-- BEGIN_INCLUDE(manifest) --> 2 <!-- BEGIN_INCLUDE(manifest) -->
3 <manifest xmlns:android="http://schemas.android.com/apk/res/android" 3 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
4 - package="com.sec.dalidemo"  
5 android:versionCode="1" 4 android:versionCode="1"
6 android:versionName="1.0"> 5 android:versionName="1.0">
7 <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> 6 <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
build/android/build.gradle
@@ -2,17 +2,17 @@ @@ -2,17 +2,17 @@
2 buildscript { 2 buildscript {
3 repositories { 3 repositories {
4 google() 4 google()
5 - jcenter() 5 + mavenCentral()
6 } 6 }
7 dependencies { 7 dependencies {
8 - classpath 'com.android.tools.build:gradle:3.5.2' 8 + classpath 'com.android.tools.build:gradle:8.1.0'
9 } 9 }
10 } 10 }
11 11
12 allprojects { 12 allprojects {
13 repositories { 13 repositories {
14 google() 14 google()
15 - jcenter() 15 + mavenCentral()
16 } 16 }
17 } 17 }
18 18
@@ -21,6 +21,8 @@ task clean(type: Delete) { @@ -21,6 +21,8 @@ task clean(type: Delete) {
21 } 21 }
22 22
23 23
24 - 24 +tasks.withType(JavaCompile) {
  25 + options.deprecation = true
  26 +}
25 27
26 28
build/android/build.sh
@@ -25,10 +25,18 @@ if [ ! -d &quot;$ANDROID_SDK&quot; ]; then @@ -25,10 +25,18 @@ if [ ! -d &quot;$ANDROID_SDK&quot; ]; then
25 if [ ! -d "$ROOT_DIR/Android/Sdk" ]; then 25 if [ ! -d "$ROOT_DIR/Android/Sdk" ]; then
26 mkdir -p "$ROOT_DIR/Android/Sdk" 26 mkdir -p "$ROOT_DIR/Android/Sdk"
27 cd "$ROOT_DIR/Android/Sdk" 27 cd "$ROOT_DIR/Android/Sdk"
28 - wget --quiet https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip  
29 - unzip -q sdk-tools-linux-4333796.zip  
30 - tools/bin/sdkmanager --update $SdbProxyOptions  
31 - 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" 28 + wget --quiet https://developer.android.com/studio/index.html
  29 + if [ ! -f index.html ]; then echo ERROR: Unable to get Android Tools Version; exit 1; fi
  30 +
  31 + androidCommandLineToolsPkgUrl=$(cat index.html | grep "commandlinetools-linux-" | grep href | cut -d\" -f 2)
  32 + androidCommandLineToolsPkgName=$(echo $androidCommandLineToolsPkgUrl | rev | cut -d\/ -f 1 | rev)
  33 + echo "Downloading Android Command Line Tools from: $androidCommandLineToolsPkgUrl"
  34 + wget --quiet $androidCommandLineToolsPkgUrl
  35 + echo "Unzipping $androidCommandLineToolsPkgName"
  36 + unzip -q $androidCommandLineToolsPkgName
  37 + SDK_MANAGER="$ROOT_DIR/Android/Sdk/cmdline-tools/bin/sdkmanager --sdk_root=$ROOT_DIR/Android/Sdk $SdbProxyOptions"
  38 + $SDK_MANAGER --update
  39 + 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"
32 cd - 40 cd -
33 fi 41 fi
34 fi 42 fi
@@ -53,11 +61,12 @@ if [ ! -d &quot;$ANDROID_NDK&quot; ]; then @@ -53,11 +61,12 @@ if [ ! -d &quot;$ANDROID_NDK&quot; ]; then
53 fi 61 fi
54 fi 62 fi
55 63
56 -if [ ! -d "$ROOT_DIR/gradle/gradle-5.4.1" ]; then 64 +GRADLE_VERSION=8.3
  65 +if [ ! -d "$ROOT_DIR/gradle/gradle-$GRADLE_VERSION" ]; then
57 mkdir -p $ROOT_DIR/gradle 66 mkdir -p $ROOT_DIR/gradle
58 cd $ROOT_DIR/gradle 67 cd $ROOT_DIR/gradle
59 - wget --quiet https://services.gradle.org/distributions/gradle-5.4.1-bin.zip  
60 - unzip -q gradle-5.4.1-bin.zip 68 + wget --quiet https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip
  69 + unzip -q gradle-$GRADLE_VERSION-bin.zip
61 cd - 70 cd -
62 fi 71 fi
63 72
@@ -65,6 +74,7 @@ GRADLE_PROPERTIES_FILE=gradle.properties @@ -65,6 +74,7 @@ GRADLE_PROPERTIES_FILE=gradle.properties
65 if [ ! -f $GRADLE_PROPERTIES_FILE ] 74 if [ ! -f $GRADLE_PROPERTIES_FILE ]
66 then 75 then
67 echo "org.gradle.jvmargs=-Xmx1536m" > $GRADLE_PROPERTIES_FILE 76 echo "org.gradle.jvmargs=-Xmx1536m" > $GRADLE_PROPERTIES_FILE
  77 + echo "android.useAndroidX=true" >> $GRADLE_PROPERTIES_FILE
68 if [ ! -z $http_proxy ] 78 if [ ! -z $http_proxy ]
69 then 79 then
70 echo "systemProp.http.proxyHost=$proxyHost" >> $GRADLE_PROPERTIES_FILE 80 echo "systemProp.http.proxyHost=$proxyHost" >> $GRADLE_PROPERTIES_FILE
@@ -72,7 +82,9 @@ then @@ -72,7 +82,9 @@ then
72 82
73 if [ ! -z $https_proxy ] 83 if [ ! -z $https_proxy ]
74 then 84 then
75 - httpsProxyFull=${https_proxy/https:\/\/} 85 + httpsProxyFull=$https_proxy
  86 + httpsProxyFull=${httpsProxyFull/https:\/\/}
  87 + httpsProxyFull=${httpsProxyFull/http:\/\/}
76 httpsProxyHost=$(echo $httpsProxyFull | cut -d: -f 1) 88 httpsProxyHost=$(echo $httpsProxyFull | cut -d: -f 1)
77 httpsProxyPort=$(echo $httpsProxyFull | cut -d: -f 2) 89 httpsProxyPort=$(echo $httpsProxyFull | cut -d: -f 2)
78 echo "systemProp.https.proxyHost=$httpsProxyHost" >> $GRADLE_PROPERTIES_FILE 90 echo "systemProp.https.proxyHost=$httpsProxyHost" >> $GRADLE_PROPERTIES_FILE
@@ -81,10 +93,10 @@ then @@ -81,10 +93,10 @@ then
81 fi 93 fi
82 fi 94 fi
83 95
84 -export PATH=$PATH:$ROOT_DIR/gradle/gradle-5.4.1/bin 96 +export PATH=$PATH:$ROOT_DIR/gradle/gradle-$GRADLE_VERSION/bin
85 [ ! -f local.properties ] && echo 'sdk.dir='$(echo $ANDROID_SDK) > local.properties 97 [ ! -f local.properties ] && echo 'sdk.dir='$(echo $ANDROID_SDK) > local.properties
86 98
87 -gradle wrapper 99 +gradle wrapper || exit 1
88 if [ "$1" = "clean" ]; then 100 if [ "$1" = "clean" ]; then
89 ./gradlew clean 101 ./gradlew clean
90 else 102 else