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 11 * [NON-SMACK Targets](#non-smack-targets)
12 12 * [SMACK enabled Targets](#smack-enabled-targets)
13 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 16 * [Build with the Visual Studio project](#build-with-the-visual-studio-project)
17 17 * [Build with CMake](#build-with-cmake)
18 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 85  
86 86 ### Requirements
87 87  
88   - - Ubuntu 16.04 or later
  88 + - Ubuntu 20.04 or later
  89 + - Open JDK Version 17 or above
89 90 - Android DALi dependencies
90 91 - If you are behind a proxy, please set up the "http_proxy" and "https_proxy" environment variables appropriately
91 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 212 - Add 2 lines to `shared/dali-demo-strings.h` for the title of your application, please keep in alphabetic order,
212 213 - Add as many translations of the title as possible to the files in `resources/po`. Currently, this only works on Ubuntu.
213 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 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 8 def daliEnvFilesDir = daliEnvDir + '/files'
9 9  
10 10 android {
  11 + namespace = "com.sec.dalidemo"
11 12 signingConfigs {
12 13 config {
13 14 storeFile file("../key.jks")
... ... @@ -30,7 +31,6 @@ android {
30 31 }
31 32 }
32 33 }
33   - project.archivesBaseName = 'dali-demo'
34 34 aaptOptions {
35 35 noCompress ''
36 36 }
... ... @@ -81,8 +81,8 @@ android {
81 81 }
82 82 }
83 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 114 commandLine 'sh', './build.sh', 'clean'
115 115 }
116 116  
  117 +
  118 +tasks.withType(JavaCompile) {
  119 + options.deprecation = true
  120 +}
  121 +
117 122 buildDali.dependsOn buildDaliDependencies
118 123 preBuild.dependsOn buildDali
119 124  
... ...
build/android/app/src/main/AndroidManifest.xml
1 1 <?xml version="1.0" encoding="utf-8"?>
2 2 <!-- BEGIN_INCLUDE(manifest) -->
3 3 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
4   - package="com.sec.dalidemo"
5 4 android:versionCode="1"
6 5 android:versionName="1.0">
7 6 <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
... ...
build/android/build.gradle
... ... @@ -2,17 +2,17 @@
2 2 buildscript {
3 3 repositories {
4 4 google()
5   - jcenter()
  5 + mavenCentral()
6 6 }
7 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 12 allprojects {
13 13 repositories {
14 14 google()
15   - jcenter()
  15 + mavenCentral()
16 16 }
17 17 }
18 18  
... ... @@ -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 25 if [ ! -d "$ROOT_DIR/Android/Sdk" ]; then
26 26 mkdir -p "$ROOT_DIR/Android/Sdk"
27 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 40 cd -
33 41 fi
34 42 fi
... ... @@ -53,11 +61,12 @@ if [ ! -d &quot;$ANDROID_NDK&quot; ]; then
53 61 fi
54 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 66 mkdir -p $ROOT_DIR/gradle
58 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 70 cd -
62 71 fi
63 72  
... ... @@ -65,6 +74,7 @@ GRADLE_PROPERTIES_FILE=gradle.properties
65 74 if [ ! -f $GRADLE_PROPERTIES_FILE ]
66 75 then
67 76 echo "org.gradle.jvmargs=-Xmx1536m" > $GRADLE_PROPERTIES_FILE
  77 + echo "android.useAndroidX=true" >> $GRADLE_PROPERTIES_FILE
68 78 if [ ! -z $http_proxy ]
69 79 then
70 80 echo "systemProp.http.proxyHost=$proxyHost" >> $GRADLE_PROPERTIES_FILE
... ... @@ -72,7 +82,9 @@ then
72 82  
73 83 if [ ! -z $https_proxy ]
74 84 then
75   - httpsProxyFull=${https_proxy/https:\/\/}
  85 + httpsProxyFull=$https_proxy
  86 + httpsProxyFull=${httpsProxyFull/https:\/\/}
  87 + httpsProxyFull=${httpsProxyFull/http:\/\/}
76 88 httpsProxyHost=$(echo $httpsProxyFull | cut -d: -f 1)
77 89 httpsProxyPort=$(echo $httpsProxyFull | cut -d: -f 2)
78 90 echo "systemProp.https.proxyHost=$httpsProxyHost" >> $GRADLE_PROPERTIES_FILE
... ... @@ -81,10 +93,10 @@ then
81 93 fi
82 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 97 [ ! -f local.properties ] && echo 'sdk.dir='$(echo $ANDROID_SDK) > local.properties
86 98  
87   -gradle wrapper
  99 +gradle wrapper || exit 1
88 100 if [ "$1" = "clean" ]; then
89 101 ./gradlew clean
90 102 else
... ...