Lets say I have a compiled Java programm called launchProgramm.class. It takes 2 parametes of String. And I have a gradle build script of some modules. The high-lvl script looks like this :
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
}
}
allprojects {
repositories {
mavenCentral()
}
}
and I have a script in the main module :
apply plugin: ‘com.android.application’
def getVersionName = { ->
try {
def stdout = new ByteArrayOutputStream()
exec {
commandLine /*something*/
standardOutput = stdout
}
def date = new Date()
def formattedDate = date.format('_yyyy_MM_dd_HH_mm_ss')
return stdout.toString().trim() + formattedDate
}
catch (ignored) {
return "unknown version";
}
}
android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName getVersionName()
}
signingConfigs {
debug {
storeFile ...
storePassword ...
keyAlias ...
keyPassword ...
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
lintOptions {
abortOnError false
}
productFlavors {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:19.+'
compile project(': prg1')
compile project(':prg2')
compile project(':prg3')
compile project(':prg4')
}
I need to do some things with .apk file after all gradle build is finished. Lets say I want to copy it to another directory or open it and change some files. Is ip possible?