Skip to content

Commit

Permalink
Merge pull request iBotPeaches#94 from iBotPeaches/gradle_refresh
Browse files Browse the repository at this point in the history
Gradle Refresh
  • Loading branch information
iBotPeaches committed Oct 23, 2014
2 parents 869d287 + aba5408 commit d4fc7fa
Show file tree
Hide file tree
Showing 12 changed files with 154 additions and 224 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jdk:
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq libstdc++6:i386 lib32z1 expect
script: "./gradlew build fatJar proguard"
script: ./scripts/travis-ci/run-tests.sh
branches:
only:
- master
Expand Down
98 changes: 0 additions & 98 deletions brut.apktool/NOTICE-smali

This file was deleted.

4 changes: 2 additions & 2 deletions brut.apktool/apktool-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
apply plugin: 'fatjar'
apply plugin: 'eu.appsatori.fatjar'

configurations {
proguard
}

dependencies {
compile project(':brut.apktool:apktool-lib')
proguard 'net.sf.proguard:proguard-base:4.8'
proguard depends.proguard
}

gradle.taskGraph.whenReady {
Expand Down
35 changes: 17 additions & 18 deletions brut.apktool/apktool-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import org.apache.tools.ant.filters.*

processResources {
Expand All @@ -30,21 +29,21 @@ processResources {
}

dependencies {
compile ("junit:junit:4.10") {
exclude(module: 'hamcrest-core')
}
compile("junit:junit:4.10") {
exclude(module: 'hamcrest-core')
}

compile project(':brut.j.dir'),
project(':brut.j.util'),
project(':brut.j.common'),
project(':brut.apktool.smali:util'),
project(':brut.apktool.smali:dexlib2'),
project(':brut.apktool.smali:baksmali'),
project(':brut.apktool.smali:smali'),
"org.yaml:snakeyaml:1.12",
"xpp3:xpp3:1.1.4c",
"xmlunit:xmlunit:1.3",
"com.google.guava:guava:12.0",
"org.apache.commons:commons-lang3:3.1"
}
compile project(':brut.j.dir'),
project(':brut.j.util'),
project(':brut.j.common'),
project(':brut.apktool.smali:util'),
project(':brut.apktool.smali:dexlib2'),
project(':brut.apktool.smali:baksmali'),
project(':brut.apktool.smali:smali'),
depends.snakeyaml,
depends.xmlpull,
depends.guava,
depends.commons_lang

testCompile depends.xmlunit
}
2 changes: 1 addition & 1 deletion brut.j.common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
*/

dependencies {
testCompile 'junit:junit:4.8.2'
testCompile depends.junit
}

6 changes: 3 additions & 3 deletions brut.j.dir/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

dependencies {
compile project(':brut.j.common'),
project(':brut.j.util')
testCompile "junit:junit:3.8.1"
compile project(':brut.j.common'),
project(':brut.j.util')
testCompile depends.junit
}
8 changes: 4 additions & 4 deletions brut.j.util/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/

dependencies {
compile project(':brut.j.common')
compile "commons-io:commons-io:2.4",
"org.apache.commons:commons-compress:1.4.1"
testCompile "junit:junit:3.8.1"
compile project(':brut.j.common'),
depends.commons_io,
depends.commons_compress
testCompile depends.junit
}
150 changes: 64 additions & 86 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,77 +15,47 @@
*/
apply plugin: 'java'
apply plugin: 'maven'
apply from: 'gradle/functions.gradle'

def apktoolversion_major = '2.0.0'
def apktoolversion_minor = 'RC2';

if (!('release' in gradle.startParameter.taskNames)) {
def hash = getCheckedOutGitCommitHash();

if (hash == null) {
project.ext.set("hash", "dirty")
project.ext.set("apktool_version", apktoolversion_major + "-dirty")
println "Building SNAPSHOT (no .git folder found)";
} else {
project.ext.set("hash", hash);
project.ext.set("apktool_version", apktoolversion_major + "-" + hash + "-SNAPSHOT");
println "Building SNAPSHOT (" + getCheckedOutBranch() + "): " + hash;
}
} else {
project.ext.set("hash", "")
project.ext.set("apktool_version", apktoolversion_major + "-" + apktoolversion_minor);
println "Building RELEASE (" + getCheckedOutBranch() + "): " + apktoolversion_major + "-" + apktoolversion_minor;
}
sourceCompatibility = 1.7
targetCompatibility = 1.7

// https://gist.github.com/JonasGroeger/7620911
def getCheckedOutGitCommitHash() {
def gitFolder = "$projectDir/.git/"
def takeFromHash = 6

def head
try {
head = new File(gitFolder + "HEAD").text.split(":")
} catch(Exception e) {
return null;
}

def isCommit = head.length == 1
if(isCommit) return head[0].trim().take(takeFromHash)

def refHead = new File(gitFolder + head[1].trim())
refHead.text.trim().take takeFromHash
}
if (!('release' in gradle.startParameter.taskNames)) {
def hash = getCheckedOutGitCommitHash();

def getCheckedOutBranch() {
def gitFolder = "$projectDir/.git/"

def head
try {
head = new File(gitFolder + "HEAD").text.split("/")
return head[2].trim();
} catch(Exception e) {
return "";
if (hash == null) {
project.ext.set("hash", "dirty")
project.ext.set("apktool_version", apktoolversion_major + "-dirty")
println "Building SNAPSHOT (no .git folder found)";
} else {
project.ext.set("hash", hash);
project.ext.set("apktool_version", apktoolversion_major + "-" + hash + "-SNAPSHOT");
println "Building SNAPSHOT (" + getCheckedOutBranch() + "): " + hash;
}
return "SNAPSHOT";
}

repositories {
mavenCentral()
} else {
project.ext.set("hash", "")
project.ext.set("apktool_version", apktoolversion_major + "-" + apktoolversion_minor);
println "Building RELEASE (" + getCheckedOutBranch() + "): " + apktoolversion_major + "-" + apktoolversion_minor;
}

sourceCompatibility = 1.7
targetCompatibility = 1.7

build.doFirst {
def javaVersion = System.getProperty("java.version")

//fail the build if we don't have the expected Java version
if (!javaVersion.startsWith("1.7")) {
throw new GradleException("You can fix this problem!\nWe found a " + javaVersion + " JDK\nPlease update JAVA_HOME to use a 1.7 JDK\nCurrently it is set to: " + System.getProperty("java.home"));
}
throw new GradleException("You can fix this problem!\n" +
"We found a " + javaVersion + " JDK\n" +
"Please update JAVA_HOME to use a 1.7 JDK\n" +
"Currently it is set to: " + System.getProperty("java.home")
);
}
}

task wrapper(type: Wrapper) {
gradleVersion = '1.10'
gradleVersion = '2.1'
}

// used for official releases only. Please don't use
Expand All @@ -94,44 +64,52 @@ task release {

buildscript {
repositories {
mavenCentral()
jcenter()
}
tasks.withType(Compile) {
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.incremental = true
}
dependencies {
classpath 'eu.appsatori:gradle-fatjar-plugin:0.2-rc1'
classpath 'eu.appsatori:gradle-fatjar-plugin:0.3'
}
}

subprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'idea'

ext {
depends = [guava: 'com.google.guava:guava:14.0',
findbugs: 'com.google.code.findbugs:jsr305:1.3.9',
junit: 'junit:junit:4.6',
antlr_runtime: 'org.antlr:antlr-runtime:3.5',
antlr: 'org.antlr:antlr:3.5',
commons_cli: 'commons-cli:commons-cli:1.2',
jflex: 'de.jflex:jflex:1.4.3',
proguard: 'net.sf.proguard:proguard-base:4.8'
]
}

repositories {
mavenCentral()
}

dependencies {
testCompile 'junit:junit:4.8.2'
}

test {
testLogging {
exceptionFormat = 'full'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'idea'

ext {
depends = [
antlr: 'org.antlr:antlr:3.5',
antlr_runtime: 'org.antlr:antlr-runtime:3.5',
commons_cli: 'commons-cli:commons-cli:1.2',
commons_compress: 'org.apache.commons:commons-compress:1.4.1',
commons_io: 'commons-io:commons-io:2.4',
commons_lang: 'org.apache.commons:commons-lang3:3.1',
findbugs: 'com.google.code.findbugs:jsr305:1.3.9',
guava: 'com.google.guava:guava:14.0',
jflex: 'de.jflex:jflex:1.4.3',
junit: 'junit:junit:4.6',
proguard: 'net.sf.proguard:proguard-base:4.8',
snakeyaml: 'org.yaml:snakeyaml:1.12',
xmlpull: 'xpp3:xpp3:1.1.4c',
xmlunit: 'xmlunit:xmlunit:1.3',
]
}

repositories {
mavenCentral()
}

dependencies {
testCompile depends.junit
}

test {
testLogging {
exceptionFormat = 'full'
}
}
}
}
Loading

0 comments on commit d4fc7fa

Please sign in to comment.