From 2d150fd2a3b707ef3d2916e319ea8232245284a9 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Mon, 22 Oct 2012 13:02:28 +0200 Subject: [PATCH] Improve build.xml to prevent copying the one from the Android SDK. --- .gitignore | 1 - Makefile | 5 +- ant.properties | 3 + build.xml | 1609 +++------------------------------------------- custom_rules.xml | 58 ++ 5 files changed, 143 insertions(+), 1533 deletions(-) create mode 100644 ant.properties create mode 100644 custom_rules.xml diff --git a/.gitignore b/.gitignore index bc3eff6ed..325ea56b0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ obj gen bin doc -ant.properties local.properties tests/*$py.class tests/build.xml diff --git a/Makefile b/Makefile index 0bf4494c7..803b94c5b 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,6 @@ NUMCPUS=$(shell grep -c '^processor' /proc/cpuinfo || echo "4" ) TOPDIR=$(shell pwd) PATCH_FFMPEG=$(shell cd submodules/externals/ffmpeg && git status | grep neon) LINPHONE_VERSION=$(shell grep -e '^.C_INIT' submodules/linphone/configure.ac | sed -e 's/.*linphone]\,\[//' |sed -e 's/\].*//' ) -KEYSTORE=bc-android.keystore -KEYALIAS=nw8000 all: prepare-sources generate-libs generate-apk install-apk run-linphone @@ -54,11 +52,10 @@ generate-libs: update-project: $(SDK_PATH)/android update project --path . - echo "key.store=$(KEYSTORE)" > ant.properties - echo "key.alias=$(KEYALIAS)" >> ant.properties touch default.properties generate-apk: + ant clean ant debug install-apk: generate-apk diff --git a/ant.properties b/ant.properties new file mode 100644 index 000000000..7ddeeeb30 --- /dev/null +++ b/ant.properties @@ -0,0 +1,3 @@ +source.dir=src:submodules/linphone/mediastreamer2/java/src:submodules/linphone/java/j2se:submodules/linphone/java/common:submodules/linphone/java/impl:submodules/linphone/coreapi/help/java +key.store=bc-android.keystore +key.alias=nw8000 diff --git a/build.xml b/build.xml index 623465b90..5dedac939 100644 --- a/build.xml +++ b/build.xml @@ -1,1539 +1,92 @@ - - + - Follows: - - custom task definitions, - - more properties (do not override those unless the whole build system is modified). - - macros used throughout the build, - - base build targets, - - debug-specific build targets, - - release-specific build targets, - - instrument-specific build targets, - - test project-specific build targets, - - install targets, - - help target - --> + - - + source.dir + The name of the source directory. Default is 'src'. + out.dir + The name of the output directory. Default is 'bin'. - + For other overridable properties, look at the beginning of the rules + files in the SDK, at tools/ant/build.xml - - - - - - - - - - + Properties related to the SDK location or the project target should + be updated using the 'android' tool with the 'update' action. - - + This file is an integral part of the build system for your + application and should be checked into Version Control Systems. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @{elseText} - - - - - - - - - - - - - - - - - - - - - @{elseText} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Running tests ... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Uninstalling @{app.package} from the default emulator or device... - - - - - - - - - - - - - - - - - - - - - - - - - Project Name: ${ant.project.name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Switching between debug and non debug build: Deleting previous compilation output... - - - - - - - - - - - - - Switching from instrumented to non-instrumented build: Deleting previous compilation output... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Resolving Build Target for ${ant.project.name}... - - - - - - - ---------- - Creating output directories if needed... - - - - - - - - - - ---------- - Resolving Dependencies for ${ant.project.name}... - - - - - - - - - - - - - - - - - ---------- - Building Libraries with '${project.libraries.target}'... - - - - - - - - - - - - - - - - - - - ---------- - Building tested project at ${tested.project.absolute.dir} with '${tested.project.target}'... - - - - - - - - - - - - - - - - - - - - - - - - - - Handling aidl files... - - - - - - - - - - ---------- - Handling RenderScript files... - - - - - ---------- - Handling Resources... - - - - - - ---------- - Handling BuildConfig class... - - - - - - - - - - - - - - - - - - - - - - - - - - Instrumenting classes from ${out.absolute.dir}/classes... - - - - - - - - - - - - - - - - - - - - - Creating library output jar file... - - - - - - - Custom jar packaging exclusion: ${android.package.excludes} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -include "${proguard.configcmd}" - -include "${out.absolute.dir}/proguard.txt" - -injars ${project.all.classes.value} - -outjars "${obfuscated.jar.file}" - -libraryjars ${project.target.classpath.value} - -dump "${obfuscate.absolute.dir}/dump.txt" - -printseeds "${obfuscate.absolute.dir}/seeds.txt" - -printusage "${obfuscate.absolute.dir}/usage.txt" - -printmapping "${obfuscate.absolute.dir}/mapping.txt" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Debug Package: ${out.final.file} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - No key.store and key.alias properties found in build.properties. - Please sign ${out.packaged.file} manually - and run zipalign from the Android SDK tools. - - - - - - - proguard.config is ${proguard.config} - - - - - - - - - Proguard.config is enabled - - - - - - - - - - - - - - - - - - - - - - - - - - - - ************************************************* - **** Android Manifest has debuggable=true **** - **** Doing DEBUG packaging with RELEASE keys **** - ************************************************* - - - - - - - - - - - - - - - - Signing final apk... - - - - - Release Package: ${out.final.file} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Instrumented Package: ${out.final.file} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - WARNING: Code Coverage is currently only supported on the emulator and rooted devices. - - - - - - - - Downloading coverage file into project directory... - - - - - - - Extracting coverage report... - - - - - - - - - - - - - - - - - - - Cleaning up temporary files... - - - Saving the report file in ${out.absolute.dir}/coverage.html - - - - - - - - - - - - - - - - - - - - - - - - - - - - Installing ${out.final.file} onto default emulator or device... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Install file not specified. - - 'ant install' now requires the build target to be specified as well. - - - ant debug install - ant release install - ant instrument install - This will build the given package and install it. - - Alternatively, you can use - ant installd - ant installr - ant installi - ant installt - to only install an existing package (this will not rebuild the package.) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Android Ant Build. Available targets: - help: Displays this help. - clean: Removes output files created by other targets. - The 'all' target can be used to clean dependencies - (tested projects and libraries)at the same time - using: 'ant all clean' - debug: Builds the application and signs it with a debug key. - The 'nodeps' target can be used to only build the - current project and ignore the libraries using: - 'ant nodeps debug' - release: Builds the application. The generated apk file must be - signed before it is published. - The 'nodeps' target can be used to only build the - current project and ignore the libraries using: - 'ant nodeps release' - instrument:Builds an instrumented package and signs it with a - debug key. - test: Runs the tests. Project must be a test project and - must have been built. Typical usage would be: - ant [emma] debug install test - emma: Transiently enables code coverage for subsequent - targets. - install: Installs the newly build package. Must either be used - in conjunction with a build target (debug/release/ - instrument) or with the proper suffix indicating - which package to install (see below). - If the application was previously installed, the - application is reinstalled if the signature matches. - installd: Installs (only) the debug package. - installr: Installs (only) the release package. - installi: Installs (only) the instrumented package. - installt: Installs (only) the test and tested packages (unless - nodeps is used as well. - uninstall: Uninstalls the application from a running emulator or - device. Also uninstall tested package if applicable - unless 'nodeps' is used as well. - diff --git a/custom_rules.xml b/custom_rules.xml new file mode 100644 index 000000000..42ea88179 --- /dev/null +++ b/custom_rules.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +