mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-07 11:09:49 +08:00
Gradle build updates
- Switch to using gradle to build jni lib. - Enable proguard minification. - Add the Android support library.
This commit is contained in:
@@ -5,26 +5,28 @@ android {
|
|||||||
buildToolsVersion "23.0.3"
|
buildToolsVersion "23.0.3"
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.android.support:support-annotations:23.3.0'
|
compile 'com.android.support:support-annotations:23.4.0'
|
||||||
}
|
compile "com.android.support:support-v4:23.4.0"
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
main {
|
|
||||||
jni.srcDirs = []
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.termux"
|
applicationId "com.termux"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 23
|
targetSdkVersion 23
|
||||||
versionCode 34
|
versionCode 35
|
||||||
versionName "0.34"
|
versionName "0.35"
|
||||||
|
|
||||||
|
ndk {
|
||||||
|
moduleName "libtermux"
|
||||||
|
abiFilters "armeabi-v7a", "arm64-v8a", "x86"
|
||||||
|
cFlags "-std=c11 -Wall -Wextra -Os -fno-stack-protector -nostdlib -Wl,--gc-sections"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled false
|
minifyEnabled true
|
||||||
|
shrinkResources true
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +0,0 @@
|
|||||||
LOCAL_PATH:= $(call my-dir)
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
LOCAL_MODULE:= libtermux
|
|
||||||
LOCAL_SRC_FILES:= termux.c
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
|
@@ -1,5 +0,0 @@
|
|||||||
APP_ABI := arm64-v8a armeabi-v7a x86
|
|
||||||
APP_PLATFORM := android-21
|
|
||||||
NDK_TOOLCHAIN_VERSION := 4.9
|
|
||||||
APP_CFLAGS := -std=c11 -Wall -Wextra -Os -fno-stack-protector
|
|
||||||
APP_LDFLAGS = -nostdlib -Wl,--gc-sections
|
|
@@ -1,21 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Script to build jni libraries while waiting for the new gradle build system:
|
|
||||||
# http://tools.android.com/tech-docs/new-build-system/gradle-experimental#TOC-Ndk-Integration
|
|
||||||
|
|
||||||
set -e -u
|
|
||||||
|
|
||||||
SRC_JNILIBS=app/src/main/jniLibs/
|
|
||||||
rm -Rf $SRC_JNILIBS
|
|
||||||
mkdir -p $SRC_JNILIBS
|
|
||||||
|
|
||||||
PROJECTDIR=`mktemp -d`
|
|
||||||
JNIDIR=$PROJECTDIR/jni
|
|
||||||
LIBSDIR=$PROJECTDIR/libs
|
|
||||||
|
|
||||||
mkdir $JNIDIR
|
|
||||||
cp app/src/main/jni/* $JNIDIR/
|
|
||||||
|
|
||||||
ndk-build NDK_PROJECT_PATH=$PROJECTDIR
|
|
||||||
cp -Rf $LIBSDIR/* $SRC_JNILIBS
|
|
||||||
|
|
||||||
rm -Rf $PROJECTDIR
|
|
@@ -1,19 +1,17 @@
|
|||||||
# Project-wide Gradle settings.
|
## Project-wide Gradle settings.
|
||||||
|
#
|
||||||
# IDE (e.g. Android Studio) users:
|
|
||||||
# Gradle settings configured through the IDE *will override*
|
|
||||||
# any settings specified in this file.
|
|
||||||
|
|
||||||
# For more details on how to configure your build environment visit
|
# For more details on how to configure your build environment visit
|
||||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||||
|
#
|
||||||
# Specifies the JVM arguments used for the daemon process.
|
# Specifies the JVM arguments used for the daemon process.
|
||||||
# The setting is particularly useful for tweaking memory settings.
|
# The setting is particularly useful for tweaking memory settings.
|
||||||
# Default value: -Xmx10248m -XX:MaxPermSize=256m
|
# Default value: -Xmx10248m -XX:MaxPermSize=256m
|
||||||
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||||
org.gradle.jvmargs=-Xmx2048M
|
#
|
||||||
|
|
||||||
# When configured, Gradle will run in incubating parallel mode.
|
# When configured, Gradle will run in incubating parallel mode.
|
||||||
# This option should only be used with decoupled projects. More details, visit
|
# This option should only be used with decoupled projects. More details, visit
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||||
# org.gradle.parallel=true
|
# org.gradle.parallel=true
|
||||||
|
#Fri May 13 01:11:09 CEST 2016
|
||||||
|
org.gradle.jvmargs=-Xmx2048M
|
||||||
|
android.useDeprecatedNdk=true
|
||||||
|
Reference in New Issue
Block a user