First step to migrate from ant to gradle
This commit is contained in:
parent
1a641f269a
commit
a094d88062
3 changed files with 177 additions and 63 deletions
137
build.gradle
137
build.gradle
|
@ -1,11 +1,19 @@
|
|||
// Project information
|
||||
buildDir = 'bin'
|
||||
ext.linphonePackageName = "org.linphone"
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
mavenLocal()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.2.0'
|
||||
}
|
||||
}
|
||||
|
||||
// Android
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
dependencies {
|
||||
|
@ -13,8 +21,34 @@ dependencies {
|
|||
}
|
||||
|
||||
android {
|
||||
defaultConfig {
|
||||
compileSdkVersion 23
|
||||
buildToolsVersion "23.0.2"
|
||||
applicationId "org.linphone"
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
checkReleaseBuilds false
|
||||
// Or, if you prefer, you can continue to check for errors in release builds,
|
||||
// but continue the build even when errors are found:
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
// Signing
|
||||
signingConfigs {
|
||||
release {
|
||||
storeFile file(RELEASE_STORE_FILE)
|
||||
storePassword RELEASE_STORE_PASSWORD
|
||||
keyAlias RELEASE_KEY_ALIAS
|
||||
keyPassword RELEASE_KEY_PASSWORD
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
|
@ -43,3 +77,106 @@ android {
|
|||
release.setRoot('build-types/release')
|
||||
}
|
||||
}
|
||||
|
||||
///////////// Task /////////////
|
||||
// TODO
|
||||
def getSdkDir() {
|
||||
Properties local = new Properties()
|
||||
local.load(new FileInputStream("${rootDir}/local.properties"))
|
||||
return local.getProperty('sdk.dir')
|
||||
}
|
||||
|
||||
def getTarget() {
|
||||
Properties local = new Properties()
|
||||
local.load(new FileInputStream("${rootDir}/project.properties"))
|
||||
return local.getProperty('target')
|
||||
}
|
||||
|
||||
def getVersionName() {
|
||||
Properties local = new Properties()
|
||||
local.load(new FileInputStream("${rootDir}/default.properties"))
|
||||
return local.getProperty('version.name')
|
||||
}
|
||||
|
||||
ext.toolsDir = getSdkDir()
|
||||
ext.versionName = getVersionName()
|
||||
|
||||
//task myJavadocs(type: Javadoc) {
|
||||
//source = sourceSets.main.allJava
|
||||
//classpath = ${toolsDir}/platforms/${target}/android.jar:libs/android-support-v4.jar:libs/gcm.jar
|
||||
//}
|
||||
|
||||
task createLibJar(type: Jar) {
|
||||
doLast {
|
||||
baseName = "liblinphone"
|
||||
String classDir = compileReleaseJavaWithJavac.destinationDir
|
||||
|
||||
from ('submodules/linphone/java')
|
||||
include "common/org/linphone/core/*.java j2se/org/linphone/core/*.java"
|
||||
|
||||
from (classDir)
|
||||
include "org/linphone/mediastream/**/*.class org/linphone/core/**/*.class org/linphone/tools/**/*.class"
|
||||
}
|
||||
}
|
||||
|
||||
task createAndroidJar(type: Jar) {
|
||||
doLast {
|
||||
baseName = "linphone"
|
||||
String classDir = compileReleaseJavaWithJavac.destinationDir
|
||||
|
||||
from (['submodules/linphone/java',classDir])
|
||||
include ("common/org/linphone/core/*.java", "j2se/org/linphone/core/*.java", "org/linphone/mediastream/**/*.class", "org/linphone/core/**/*.class", "org/linphone/**/*.class, org/linphone/tools/**/*.class")
|
||||
}
|
||||
}
|
||||
|
||||
task liblinphoneAndroidSdk(type: Zip) {
|
||||
doLast {
|
||||
createLibJar()
|
||||
archiveName = 'liblinphone-android-sdk-${versionName}.zip'
|
||||
|
||||
from ('libs') {
|
||||
into 'libs'
|
||||
}
|
||||
include "**/*.so"
|
||||
from ('.') {
|
||||
into 'libs'
|
||||
}
|
||||
include "liblinphone.jar"
|
||||
|
||||
from ('libs-debug') {
|
||||
into 'libs-debug'
|
||||
}
|
||||
include "**/*.so"
|
||||
|
||||
from ('.') {
|
||||
into 'libs-debug'
|
||||
}
|
||||
include "liblinphone.jar"
|
||||
}
|
||||
}
|
||||
|
||||
task linphoneAndroidSdk(type: Zip) {
|
||||
doLast {
|
||||
createAndroidJar()
|
||||
archiveName = 'linphone-android-sdk-${versionName}.zip'
|
||||
|
||||
from ('libs') {
|
||||
into 'libs'
|
||||
}
|
||||
include "**/*.so"
|
||||
from ('.') {
|
||||
into 'libs'
|
||||
}
|
||||
include "linphone.jar"
|
||||
|
||||
from ('libs-debug') {
|
||||
into 'libs-debug'
|
||||
}
|
||||
include "**/*.so"
|
||||
|
||||
from ('.') {
|
||||
into 'libs-debug'
|
||||
}
|
||||
include "linphone.jar"
|
||||
}
|
||||
}
|
||||
|
|
27
prepare.py
27
prepare.py
|
@ -214,7 +214,7 @@ clean: java-clean
|
|||
install: install-apk run-linphone
|
||||
|
||||
java-clean:
|
||||
\tant clean
|
||||
\tgradle clean
|
||||
|
||||
$(TOPDIR)/res/raw/rootca.pem:
|
||||
\tcp liblinphone-sdk/android-{first_arch}/share/linphone/rootca.pem $@
|
||||
|
@ -307,30 +307,23 @@ update-mediastreamer2-project:
|
|||
|
||||
generate-apk: java-clean build copy-libs $(TOPDIR)/res/raw/rootca.pem update-project
|
||||
\techo "version.name=$(LINPHONE_ANDROID_VERSION)" > default.properties && \\
|
||||
\tant debug
|
||||
\tgradle assembleDebug
|
||||
|
||||
generate-mediastreamer2-apk: java-clean build copy-libs update-mediastreamer2-project
|
||||
\t@cd $(TOPDIR)/submodules/linphone/mediastreamer2/java && \\
|
||||
\techo "version.name=$(LINPHONE_ANDROID_VERSION)" > default.properties && \\
|
||||
\tant debug
|
||||
|
||||
quick:
|
||||
\tant clean
|
||||
\tant debug
|
||||
\tant installd
|
||||
\tant run
|
||||
quick: clean install-apk run-linphone
|
||||
|
||||
install-apk:
|
||||
\tant installd
|
||||
\tgradle installDebug
|
||||
|
||||
uninstall:
|
||||
\tadb uninstall $(PACKAGE_NAME)
|
||||
|
||||
release: java-clean build copy-libs update-project
|
||||
\tpatch -p1 < release.patch
|
||||
\tcat ant.properties | grep version.name > default.properties
|
||||
\tant release
|
||||
\tpatch -Rp1 < release.patch
|
||||
\tgradle assembleRelease
|
||||
|
||||
generate-sdk: liblinphone-android-sdk
|
||||
|
||||
|
@ -338,7 +331,7 @@ liblinphone-android-sdk: generate-apk
|
|||
\tant liblinphone-android-sdk
|
||||
|
||||
linphone-android-sdk: generate-apk
|
||||
\tant linphone-android-sdk
|
||||
\ant linphone-android-sdk
|
||||
|
||||
mediastreamer2-sdk: generate-mediastreamer2-apk
|
||||
\t@cd $(TOPDIR)/submodules/linphone/mediastreamer2/java && \\
|
||||
|
@ -348,18 +341,16 @@ liblinphone_tester:
|
|||
\t$(MAKE) -C liblinphone_tester
|
||||
|
||||
run-linphone:
|
||||
\tant run
|
||||
\tadb shell monkey -p $(PACKAGE_NAME) -c android.intent.category.LAUNCHER 1
|
||||
|
||||
run-liblinphone-tests:
|
||||
\t@cd liblinphone_tester && \\
|
||||
\tmake run-all-tests
|
||||
|
||||
run-basic-tests: update-project
|
||||
\tant partial-clean
|
||||
run-basic-tests: clean update-project
|
||||
\t$(MAKE) -C tests run-basic-tests ANT_SILENT=$(ANT_SILENT)
|
||||
|
||||
run-all-tests: update-project
|
||||
\tant partial-clean
|
||||
run-all-tests: clean update-project
|
||||
\t$(MAKE) -C tests run-all-tests ANT_SILENT=$(ANT_SILENT)
|
||||
|
||||
pull-transifex:
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
|
||||
index fcc8434..0e80ea6 100755
|
||||
--- a/AndroidManifest.xml
|
||||
+++ b/AndroidManifest.xml
|
||||
@@ -68,7 +68,8 @@
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
- android:largeHeap="true">
|
||||
+ android:largeHeap="true"
|
||||
+ android:debuggable="false">
|
||||
<activity
|
||||
android:name=".LinphoneLauncherActivity"
|
||||
android:exported="true"
|
Loading…
Reference in a new issue