Commit 6591bfab authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Remove ant buildsystem

parent c68e4b7e
# Sources and objects
export ANDROID_HOME=$(ANDROID_SDK)
ARCH = $(ANDROID_ABI)
SRC=libvlc
APP_SRC=vlc-android
JAVA_SOURCES=$(shell find $(APP_SRC)/src/org/videolan -name "*.java" -o -name "*.aidl")
JAVA_SOURCES+=$(shell find $(SRC)/src/org/videolan -name "*.java" -o -name "*.aidl")
JAVA_SOURCES+=$(shell find $(APP_SRC)/res -name "*.xml" -o -name "*.png")
JNI_SOURCES=$(SRC)/jni/*.c $(SRC)/jni/*.h
LIBVLC_LIBS = libvlcjni
ANT_OPTS += -v
VERBOSE =
GEN =
ifeq ($(RELEASE),1)
ANT_TARGET = release
VLC_APK=$(APP_SRC)/bin/VLC-release-unsigned.apk
NDK_DEBUG=0
else
ANT_TARGET = debug
VLC_APK=$(APP_SRC)/bin/VLC-debug.apk
NDK_DEBUG=1
endif
define build_apk
@echo
@echo "=== Building $(VLC_APK) for $(ARCH) ==="
@echo
date +"%Y-%m-%d" > $(APP_SRC)/assets/builddate.txt
echo `id -u -n`@`hostname` > $(APP_SRC)/assets/builder.txt
git rev-parse --short HEAD > $(APP_SRC)/assets/revision.txt
./gen-env.sh $(APP_SRC)
$(VERBOSE)cd $(APP_SRC) && ant $(ANT_OPTS) $(ANT_TARGET)
endef
$(VLC_APK): $(LIBVLCJNI) $(JAVA_SOURCES)
$(call build_apk)
apk:
$(call build_apk)
apkclean:
rm -f $(VLC_APK)
lightclean:
cd $(SRC) && rm -rf libs obj
cd $(APP_SRC) && rm -rf bin $(VLC_APK)
rm -f $(PRIVATE_LIBDIR)/*.so $(PRIVATE_LIBDIR)/*.c
clean: lightclean
rm -rf $(APP_SRC)/gen java-libs/*/gen java-libs/*/bin .sdk vlc-sdk/ vlc-sdk.7z
jniclean: lightclean
rm -rf $(LIBVLCJNI) $(APP_SRC)/libs/
distclean: clean jniclean
install: $(VLC_APK)
@echo "=== Installing VLC on device ==="
adb wait-for-device
adb install -r $(VLC_APK)
uninstall:
adb wait-for-device
adb uninstall org.videolan.vlc
run:
@echo "=== Running VLC on device ==="
adb wait-for-device
ifeq ($(URL),)
adb shell am start -n org.videolan.vlc/org.videolan.vlc.gui.MainActivity
else
adb shell am start -n org.videolan.vlc/org.videolan.vlc.gui.video.VideoPlayerActivity $(URL)
endif
build-and-run: install run
apkclean-run: apkclean build-and-run
adb logcat -c
distclean-run: distclean build-and-run
adb logcat -c
vlc-sdk.7z: .sdk
7z a $@ vlc-sdk/
.sdk:
mkdir -p vlc-sdk/libs
cd libvlc; cp -r libs/* ../vlc-sdk/libs
mkdir -p vlc-sdk/src/org/videolan
cp -r libvlc/src/org/videolan/libvlc vlc-sdk/src/org/videolan
touch $@
.PHONY: lightclean clean jniclean distclean distclean-run apkclean apkclean-run install run build-and-run
<?xml version="1.0" encoding="UTF-8"?>
<project name="WheelView" 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
Version Control Systems. -->
<property file="local.properties" />
<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:
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.
-->
<property file="ant.properties" />
<!-- if sdk.dir was not set from one of the property file, then
get it from the ANDROID_HOME env var.
This must be done before we load project.properties since
the proguard config can use sdk.dir -->
<property environment="env" />
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
<isset property="env.ANDROID_HOME" />
</condition>
<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<!-- quick check on sdk.dir -->
<fail
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."
unless="sdk.dir"
/>
<!--
Import per project custom build rules if present at the root of the project.
This is the place to put custom intermediary targets such as:
-pre-build
-pre-compile
-post-compile (This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir})
-post-package
-post-build
-pre-clean
-->
<import file="custom_rules.xml" optional="true" />
<!-- Import the actual build file.
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.
***********************
****** IMPORTANT ******
***********************
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"
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project name="libvlc" 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
Version Control Systems. -->
<property file="local.properties" />
<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:
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.
-->
<property file="ant.properties" />
<!-- if sdk.dir was not set from one of the property file, then
get it from the ANDROID_HOME env var.
This must be done before we load project.properties since
the proguard config can use sdk.dir -->
<property environment="env" />
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
<isset property="env.ANDROID_HOME" />
</condition>
<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<!-- quick check on sdk.dir -->
<fail
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."
unless="sdk.dir"
/>
<!--
Import per project custom build rules if present at the root of the project.
This is the place to put custom intermediary targets such as:
-pre-build
-pre-compile
-post-compile (This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir})
-post-package
-post-build
-pre-clean
-->
<import file="custom_rules.xml" optional="true" />
<!-- Import the actual build file.
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.
***********************
****** IMPORTANT ******
***********************
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"
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />
</project>
#! /bin/sh
# Usage rename_package.sh <new_name> <ABI>
# new_name should be a string
# ABI should be an integer, between 0 and 4
# ARMv7 = 0
# ARMv6_NOFPU = 1
# X86 = 2
# ARMv6_FPU = 3
# MIPS = 4
# ARMv8 = 5
# x86_64 = 6
# MIPS64 = 7
OLD_NAME=org.videolan.vlc
NEW_NAME=org.videolan.vlc.$1
echo $NEW_NAME $2
OLD_PATH=$(echo $OLD_NAME |sed 's/\./\//g')
NEW_PATH=$(echo $NEW_NAME |sed 's/\./\//g')
sed -i.orig "s,${OLD_PATH},${NEW_PATH},g" Makefile
cd vlc-android/
sed -i.orig -e "s/versionCode\(.*\)0\"/versionCode\1$2\"/" AndroidManifest.xml
sed -i.orig -e "s/android:debuggable=\"true\"/android:debuggable=\"false\"/" AndroidManifest.xml
mv src/${OLD_PATH} src/tmp
mkdir -p src/${OLD_PATH}
mv src/tmp src/${NEW_PATH}
find . \( -name "*.xml" -o -name "*.java" -o -name "*.cfg" -o -name "*.aidl" \) -print0 | xargs -0 sed -i.orig "s/${OLD_NAME}/${NEW_NAME}/g"
find . \( -name "*.c" \) -print0 | xargs -0 sed -i.orig "s,${OLD_PATH},${NEW_PATH},g"
find jni -type f -print0 | xargs -0 sed -i.orig "s,$(echo $OLD_NAME |sed 's/\./_/g'),$(echo $NEW_NAME |sed 's/\./_/g'),g"
find . -name \*.orig -exec rm -f {} \;
<?xml version="1.0" encoding="UTF-8"?>
<project name="VLC" 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
Version Control Systems. -->
<property file="local.properties" />
<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:
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.
-->
<property file="ant.properties" />
<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<property environment="env" />
<condition property="sdk.dir" value="${env.ANDROID_SDK}" >
<and>
<not><isset property="${env.ANDROID_SDK}"/></not>
<not><isset property="sdk.dir"/></not>
</and>
</condition>
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through $ANDROID_SDK env var"
unless="sdk.dir"
/>
<!-- extension targets. Uncomment the ones where you want to do custom work
in between standard targets -->
<!--
<target name="-pre-build">
</target>
<target name="-pre-compile">
</target>
/* This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir} */
<target name="-post-compile">
</target>
-->
<!-- Import the actual build file.
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.
***********************
****** IMPORTANT ******
***********************
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"
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />
</project>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment