Skip to content

Commit

Permalink
Update target API to 28 with compatibility 4.0 - 9.0. Update gradle t…
Browse files Browse the repository at this point in the history
…o 4.6.

Implemented automatic copying of IITC script when building a mobile application from Android Studio

IITC-CE#2
  • Loading branch information
modos189 committed Nov 21, 2018
1 parent 74e94a0 commit 26e69a8
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 13 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,4 @@ To build the mobile app, along with python, you will need
- The Java JDK (development kit - the runtime JRE is not enough)
- The Android SDK

Run `build.py mobile` to build IITC Mobile in debug mode.

Note that part of the build.py process includes copying the IITC script files into the `mobile/res` subfolder.
If this isn't done (e.g. you build IITC Mobile directly from Eclipse) you will end up with a broken build.
Run `build.py mobile` to build IITC Mobile in debug mode.
2 changes: 1 addition & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def saveScriptAndMeta(script,ourDir,filename,oldDir=None):
print ("Error: mobile app failed to build. gradlew returned %d" % retcode)
exit(1) # ant may return 256, but python seems to allow only values <256
else:
shutil.copy("mobile/app/build/outputs/apk/app-%s.apk" % buildMobile, os.path.join(outDir,"IITC_Mobile-%s.apk" % buildMobile) )
shutil.copy("mobile/app/build/outputs/apk/%s/app-%s.apk" % (buildMobile, buildMobile), os.path.join(outDir,"IITC_Mobile-%s.apk" % buildMobile) )


# run any postBuild commands
Expand Down
1 change: 1 addition & 0 deletions mobile/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ local.properties
*.iws
.idea/workspace.xml
.idea/tasks.xml
.idea/misc.xml

# Proguard logs
proguard_logs/
Expand Down
27 changes: 21 additions & 6 deletions mobile/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.cradle.iitc_mobile"
minSdkVersion 14
targetSdkVersion 21
targetSdkVersion 28
}
buildTypes {
release {
runProguard false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
Expand All @@ -18,7 +18,22 @@ android {
assets.srcDirs = ['../assets']
}
}
useLibrary 'org.apache.http.legacy'
}

dependencies {
compile 'com.android.support:support-v4:19.1.0'
}
implementation 'com.android.support:appcompat-v7:28.+'
implementation fileTree(dir: 'libs', include: ['*.jar'])
}

task copyUserscripts(type: Copy)

copyUserscripts {
description = 'Updating prebuilt plugins'
from '../assets'
into 'src/main/assets'
include('*')
include('**/*')
}

preBuild.dependsOn copyUserscripts
4 changes: 3 additions & 1 deletion mobile/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
3 changes: 2 additions & 1 deletion mobile/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

0 comments on commit 26e69a8

Please sign in to comment.