ndktest

changeset 1:fe78cf853157 tip

fixed the build files
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 24 Apr 2015 03:20:17 +0300
parents 1310df7cdf25
children
files AndroidManifest.xml Makefile build.xml
diffstat 3 files changed, 103 insertions(+), 7 deletions(-) [+]
line diff
     1.1 --- a/AndroidManifest.xml	Thu Apr 23 20:54:02 2015 +0300
     1.2 +++ b/AndroidManifest.xml	Fri Apr 24 03:20:17 2015 +0300
     1.3 @@ -6,13 +6,13 @@
     1.4  
     1.5  	<uses-sdk android:minSdkVersion="9"/>
     1.6  
     1.7 -	<application android:label="@string/app_name"
     1.8 +	<application android:label="app-newtest"
     1.9  			android:hasCode="false"
    1.10 -			android:debuggable="true"
    1.11 -			android:icon="@drawable/ic_launcher">
    1.12 +			android:debuggable="true">
    1.13 +			<!-- android:icon="@drawable/ic_launcher" -->
    1.14  
    1.15  		<activity android:name="android.app.NativeActivity"
    1.16 -			android:label="@string/app_name">
    1.17 +			android:label="New NDK Test">
    1.18  
    1.19  			<meta-data android:name="android.app.lib_name" android:value="ndktest"/>
    1.20  
     2.1 --- a/Makefile	Thu Apr 23 20:54:02 2015 +0300
     2.2 +++ b/Makefile	Fri Apr 24 03:20:17 2015 +0300
     2.3 @@ -1,4 +1,4 @@
     2.4 -android_platform = android-21
     2.5 +android_platform = android-22
     2.6  
     2.7  src = $(wildcard src/*.c)
     2.8  obj = $(src:.c=.o)
     2.9 @@ -25,10 +25,10 @@
    2.10  .PHONY: release
    2.11  release: $(apk-release)
    2.12  
    2.13 -$(apk-debug): $(lib)
    2.14 +$(apk-debug): $(lib) AndroidManifest.xml
    2.15  	ant debug
    2.16  
    2.17 -$(apk-release): $(lib)
    2.18 +$(apk-release): $(lib) AndroidManifest.xml
    2.19  	ant release
    2.20  
    2.21  .PHONY: lib
    2.22 @@ -60,3 +60,7 @@
    2.23  .PHONY: stop
    2.24  stop:
    2.25  	adb shell am force-stop $(pkg)
    2.26 +
    2.27 +.PHONY: update-project
    2.28 +update-project: build.xml
    2.29 +	android update project --path . --target $(android_platform)
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/build.xml	Fri Apr 24 03:20:17 2015 +0300
     3.3 @@ -0,0 +1,92 @@
     3.4 +<?xml version="1.0" encoding="UTF-8"?>
     3.5 +<project name="ndktest" default="help">
     3.6 +
     3.7 +    <!-- The local.properties file is created and updated by the 'android' tool.
     3.8 +         It contains the path to the SDK. It should *NOT* be checked into
     3.9 +         Version Control Systems. -->
    3.10 +    <property file="local.properties" />
    3.11 +
    3.12 +    <!-- The ant.properties file can be created by you. It is only edited by the
    3.13 +         'android' tool to add properties to it.
    3.14 +         This is the place to change some Ant specific build properties.
    3.15 +         Here are some properties you may want to change/update:
    3.16 +
    3.17 +         source.dir
    3.18 +             The name of the source directory. Default is 'src'.
    3.19 +         out.dir
    3.20 +             The name of the output directory. Default is 'bin'.
    3.21 +
    3.22 +         For other overridable properties, look at the beginning of the rules
    3.23 +         files in the SDK, at tools/ant/build.xml
    3.24 +
    3.25 +         Properties related to the SDK location or the project target should
    3.26 +         be updated using the 'android' tool with the 'update' action.
    3.27 +
    3.28 +         This file is an integral part of the build system for your
    3.29 +         application and should be checked into Version Control Systems.
    3.30 +
    3.31 +         -->
    3.32 +    <property file="ant.properties" />
    3.33 +
    3.34 +    <!-- if sdk.dir was not set from one of the property file, then
    3.35 +         get it from the ANDROID_HOME env var.
    3.36 +         This must be done before we load project.properties since
    3.37 +         the proguard config can use sdk.dir -->
    3.38 +    <property environment="env" />
    3.39 +    <condition property="sdk.dir" value="${env.ANDROID_HOME}">
    3.40 +        <isset property="env.ANDROID_HOME" />
    3.41 +    </condition>
    3.42 +
    3.43 +    <!-- The project.properties file is created and updated by the 'android'
    3.44 +         tool, as well as ADT.
    3.45 +
    3.46 +         This contains project specific properties such as project target, and library
    3.47 +         dependencies. Lower level build properties are stored in ant.properties
    3.48 +         (or in .classpath for Eclipse projects).
    3.49 +
    3.50 +         This file is an integral part of the build system for your
    3.51 +         application and should be checked into Version Control Systems. -->
    3.52 +    <loadproperties srcFile="project.properties" />
    3.53 +
    3.54 +    <!-- quick check on sdk.dir -->
    3.55 +    <fail
    3.56 +            message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
    3.57 +            unless="sdk.dir"
    3.58 +    />
    3.59 +
    3.60 +    <!--
    3.61 +        Import per project custom build rules if present at the root of the project.
    3.62 +        This is the place to put custom intermediary targets such as:
    3.63 +            -pre-build
    3.64 +            -pre-compile
    3.65 +            -post-compile (This is typically used for code obfuscation.
    3.66 +                           Compiled code location: ${out.classes.absolute.dir}
    3.67 +                           If this is not done in place, override ${out.dex.input.absolute.dir})
    3.68 +            -post-package
    3.69 +            -post-build
    3.70 +            -pre-clean
    3.71 +    -->
    3.72 +    <import file="custom_rules.xml" optional="true" />
    3.73 +
    3.74 +    <!-- Import the actual build file.
    3.75 +
    3.76 +         To customize existing targets, there are two options:
    3.77 +         - Customize only one target:
    3.78 +             - copy/paste the target into this file, *before* the
    3.79 +               <import> task.
    3.80 +             - customize it to your needs.
    3.81 +         - Customize the whole content of build.xml
    3.82 +             - copy/paste the content of the rules files (minus the top node)
    3.83 +               into this file, replacing the <import> task.
    3.84 +             - customize to your needs.
    3.85 +
    3.86 +         ***********************
    3.87 +         ****** IMPORTANT ******
    3.88 +         ***********************
    3.89 +         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
    3.90 +         in order to avoid having your file be overridden by tools such as "android update project"
    3.91 +    -->
    3.92 +    <!-- version-tag: 1 -->
    3.93 +    <import file="${sdk.dir}/tools/ant/build.xml" />
    3.94 +
    3.95 +</project>