Skip to content

Android / Gradle updates (current working build) #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 55 additions & 30 deletions platform/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,46 +1,71 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
Properties properties = new Properties()
properties.load(rootProject.file('local.properties').newDataInputStream())
Properties properties = new Properties()
properties.load(rootProject.file('local.properties').newDataInputStream())

def ndkClang = properties.getProperty('readium.ndk_clang', "false")
ndkClang = (ndkClang == "true") ? true : false;
rootProject.ext.set('readium_ndk_clang', ndkClang)
def ndkClang = properties.getProperty('readium.ndk_clang', "false")
ndkClang = (ndkClang == "true") ? true : false;
rootProject.ext.set('readium_ndk_clang', ndkClang)

def ndkSkipX86 = properties.getProperty('readium.ndk_skipX86', "false")
ndkSkipX86 = (ndkSkipX86 == "true") ? true : false;
rootProject.ext.set('readium_ndk_skipX86', ndkSkipX86)
def ndkSkipX86 = properties.getProperty('readium.ndk_skipX86', "false")
ndkSkipX86 = (ndkSkipX86 == "true") ? true : false;
rootProject.ext.set('readium_ndk_skipX86', ndkSkipX86)

def ndkSkipARM = properties.getProperty('readium.ndk_skipARM', "false")
ndkSkipARM = (ndkSkipARM == "true") ? true : false;
rootProject.ext.set('readium_ndk_skipARM', ndkSkipARM)
def ndkSkipARM = properties.getProperty('readium.ndk_skipARM', "false")
ndkSkipARM = (ndkSkipARM == "true") ? true : false;
rootProject.ext.set('readium_ndk_skipARM', ndkSkipARM)

def extraCmake = properties.getProperty('readium.extra_cmake', null)
rootProject.ext.set('readium_extra_cmake', extraCmake)
def extraCmake = properties.getProperty('readium.extra_cmake', null)
rootProject.ext.set('readium_extra_cmake', extraCmake)

def readiumSdkLibDir = properties.getProperty('readium.sdk_lib_dir', null)
rootProject.ext.set('readium_sdk_lib_dir', readiumSdkLibDir)
def readiumSdkLibDir = properties.getProperty('readium.sdk_lib_dir', null)
rootProject.ext.set('readium_sdk_lib_dir', readiumSdkLibDir)

def readiumSdkIncludeDir = properties.getProperty('readium.sdk_include_dir', null)
rootProject.ext.set('readium_sdk_include_dir', readiumSdkIncludeDir)
def readiumSdkIncludeDir = properties.getProperty('readium.sdk_include_dir', null)
rootProject.ext.set('readium_sdk_include_dir', readiumSdkIncludeDir)

if (readiumSdkLibDir != null && readiumSdkIncludeDir != null) {
rootProject.ext.set('readium_lcp_build_content_filter', true)
} else {
rootProject.ext.set('readium_lcp_build_content_filter', false)
}
def lcpBuildContentFilter = false
if (readiumSdkLibDir != null && readiumSdkIncludeDir != null) {
lcpBuildContentFilter = true
rootProject.ext.set('readium_lcp_build_content_filter', true)
} else {
rootProject.ext.set('readium_lcp_build_content_filter', false)
}

//https://bintray.com/android/android-tools/com.android.tools.build.gradle/view
classpath "com.android.tools.build:gradle:2.3.3"
// println "[[${project.name}]] (ROOT) Gradle Experimental: ${ndkExperimental}"
println "[[${project.name}]] (ROOT) Skip ARM: ${ndkSkipARM}"
println "[[${project.name}]] (ROOT) Skip x86: ${ndkSkipX86}"
println "[[${project.name}]] (ROOT) Clang: ${ndkClang}"
println "[[${project.name}]] (ROOT) readiumSdkLibDir: ${readiumSdkLibDir}"
println "[[${project.name}]] (ROOT) readiumSdkIncludeDir: ${readiumSdkIncludeDir}"
println "[[${project.name}]] (ROOT) extraCmake: ${extraCmake}"

if (lcpBuildContentFilter) {
// include ':epub3'
// project(':epub3').projectDir = new File(rootProject.projectDir, './epub3')
}

buildscript {
repositories {
google()
maven {
url "https://maven.google.com"
}
mavenCentral()
jcenter()
}
dependencies {
// https://bintray.com/android/android-tools/com.android.tools.build.gradle/view
// https://mvnrepository.com/artifact/com.android.tools.build/gradle?repo=google
classpath "com.android.tools.build:gradle:3.4.1"
}
}

allprojects {
repositories {
google()
maven {
url "https://maven.google.com"
}
mavenCentral()
jcenter()
}
}
3 changes: 3 additions & 0 deletions platform/android/clean.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/sh

rm -rf build
rm -rf dist

rm -rf lib/libs
rm -rf lib/jniLibs
rm -rf lib/build
rm -rf lib/.externalNativeBuild
8 changes: 4 additions & 4 deletions platform/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
#https://services.gradle.org/distributions
# GRADLE EXPERIMENTAL requires 3.3
# GRADLE STABLE works with latest (4.4)
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
# https://services.gradle.org/distributions
# GRADLE EXPERIMENTAL requires 3.3 (the 4.1 + 0.11.1 combo fails, see https://stackoverflow.com/questions/47057160/ )
# GRADLE STABLE works with latest 5.4.1
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
Loading