hedgeroid: adjust build.xml: fix app name; set java version; print hint if sdk build.xml is missing hedgeroid
authorsheepluva
Sat, 07 Dec 2019 23:58:37 +0100
branchhedgeroid
changeset 15513 f0bf14ead75c
parent 15512 45d6806548e9
child 15514 f90255a3454c
hedgeroid: adjust build.xml: fix app name; set java version; print hint if sdk build.xml is missing
project_files/Android-build/SDL-android-project/build.xml
--- a/project_files/Android-build/SDL-android-project/build.xml	Sat Dec 07 16:18:20 2019 +0100
+++ b/project_files/Android-build/SDL-android-project/build.xml	Sat Dec 07 23:58:37 2019 +0100
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project name="MainActivity" default="help">
+<project name="Hedgewars" default="help">
 
     <!-- The local.properties file is created and updated by the 'android' tool.
          It contains the path to the SDK. It should *NOT* be checked into
@@ -79,7 +79,25 @@
          In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
          in order to avoid having your file be overridden by tools such as "android update project"
     -->
+    <property name="java.target" value="1.8" />
+    <property name="java.source" value="1.8" />
+
+    <property name="sdk.buildxml.file" value="${sdk.dir}/tools/ant/build.xml" />
+    <available file="${sdk.buildxml.file}"  property="sdk.buildxml.found" />
+
+    <fail message="Import of sdk's build.xml failed!
+${line.separator}!    Failed to import '${sdk.buildxml.file}'!
+${line.separator}!
+${line.separator}!    If the path to the sdk's folder is correct but doesn't contain any build.xml,
+${line.separator}!    then you probably have to downgrade the 'tools' folder to an older version:
+${line.separator}!        [linux]   https://dl.google.com/android/repository/tools_r25.2.5-linux.zip
+${line.separator}!        [maxosx]  https://dl.google.com/android/repository/tools_r25.2.5-macosx.zip
+${line.separator}!        [windows] https://dl.google.com/android/repository/tools_r25.2.5-windows.zip
+        "
+        unless="sdk.buildxml.found"
+    />
+
     <!-- version-tag: 1 -->
-    <import file="${sdk.dir}/tools/ant/build.xml" />
+    <import file="${sdk.buildxml.file}" />
 
 </project>