mirror of
https://github.com/revanced/smali.git
synced 2025-05-23 18:16:23 +02:00
gradleize smali project
This commit is contained in:
parent
1026c6c10c
commit
480c79aeea
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,7 +1,7 @@
|
||||
/.gradle
|
||||
/baksmali/build
|
||||
/dexlib/build
|
||||
/smali/target
|
||||
/smali/build
|
||||
/util/build
|
||||
/maven-smali-plugin/target
|
||||
/smali-integration-tests/target
|
||||
|
@ -1 +1 @@
|
||||
include 'util', 'dexlib', 'baksmali'
|
||||
include 'util', 'dexlib', 'baksmali', 'smali'
|
1
smali/.gitignore
vendored
1
smali/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/target
|
78
smali/build.gradle
Normal file
78
smali/build.gradle
Normal file
@ -0,0 +1,78 @@
|
||||
configurations {
|
||||
antlr3
|
||||
jflex
|
||||
}
|
||||
|
||||
ext.antlrSource = 'src/main/antlr3'
|
||||
ext.antlrOutput = file(new File(buildDir, '/generated-sources/antlr3'))
|
||||
|
||||
ext.jflexSource = "src/main/jflex"
|
||||
ext.jflexOutput = file(new File(buildDir, '/generated-sources/jflex'))
|
||||
|
||||
ext.testAntlrSource = 'src/test/antlr3'
|
||||
ext.testAntlrOutput = file(new File(buildDir, '/generated-test-sources/antlr3'))
|
||||
|
||||
sourceSets.main.java.srcDir antlrOutput
|
||||
sourceSets.main.java.srcDir jflexOutput
|
||||
|
||||
sourceSets.test.java.srcDir testAntlrOutput
|
||||
|
||||
dependencies {
|
||||
compile project(':util')
|
||||
compile project(':dexlib')
|
||||
compile 'org.antlr:antlr-runtime:3.2'
|
||||
compile 'commons-cli:commons-cli:1.2'
|
||||
|
||||
testCompile 'junit:junit:4.6'
|
||||
|
||||
antlr3 'org.antlr:antlr:3.2'
|
||||
jflex 'de.jflex:jflex:1.4.3'
|
||||
}
|
||||
|
||||
task generateAntlrSource {
|
||||
inputs.dir file(antlrSource)
|
||||
outputs.dir file(antlrOutput)
|
||||
doLast {
|
||||
mkdir(antlrOutput)
|
||||
|
||||
def grammars = fileTree(antlrSource).include('**/*.g')
|
||||
|
||||
ant.java(classname: 'org.antlr.Tool', classpath: configurations.antlr3.asPath, fork: true) {
|
||||
arg(line: '-fo ' + antlrOutput + '/org/jf/smali')
|
||||
arg(line: grammars.files.join(" "))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task generateTestAntlrSource {
|
||||
inputs.dir file(testAntlrSource)
|
||||
outputs.dir file(testAntlrOutput)
|
||||
doLast {
|
||||
mkdir(testAntlrOutput)
|
||||
|
||||
def grammars = fileTree(testAntlrSource).include('**/*.g')
|
||||
|
||||
ant.java(classname: 'org.antlr.Tool', classpath: configurations.antlr3.asPath, fork: true) {
|
||||
arg(line: '-fo ' + testAntlrOutput + '/org/jf/smali')
|
||||
arg(line: grammars.files.join(" "))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task generateJflexSource {
|
||||
inputs.dir file(jflexSource)
|
||||
outputs.dir file(jflexOutput)
|
||||
doLast {
|
||||
mkdir(jflexOutput)
|
||||
|
||||
def grammars = fileTree(jflexSource).include('**/*.flex')
|
||||
|
||||
ant.java(classname: 'JFlex.Main', classpath: configurations.jflex.asPath, fork: true) {
|
||||
arg(line: '-d ' + jflexOutput + '/org/jf/smali')
|
||||
arg(line: grammars.files.join(" "))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
compileJava.dependsOn generateAntlrSource, generateJflexSource
|
||||
compileTestJava.dependsOn generateTestAntlrSource
|
198
smali/pom.xml
198
smali/pom.xml
@ -1,198 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.jf</groupId>
|
||||
<artifactId>smali</artifactId>
|
||||
<version>${aversion}</version>
|
||||
<parent>
|
||||
<groupId>org.jf</groupId>
|
||||
<artifactId>smali-pom</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>de.jflex</groupId>
|
||||
<artifactId>maven-jflex-plugin</artifactId>
|
||||
<version>1.4.3</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>generate</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr3-maven-plugin</artifactId>
|
||||
<version>3.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>smaliLexer</id>
|
||||
<goals>
|
||||
<goal>antlr</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>org/jf/smali/smaliLexer.g</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>smaliParser</id>
|
||||
<goals>
|
||||
<goal>antlr</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>org/jf/smali/smaliParser.g</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>smaliTreeWalker</id>
|
||||
<goals>
|
||||
<goal>antlr</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>org/jf/smali/smaliTreeWalker.g</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>expectedTokensTestGrammar</id>
|
||||
<phase>generate-test-sources</phase>
|
||||
<goals>
|
||||
<goal>antlr</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sourceDirectory>src/test/antlr3</sourceDirectory>
|
||||
<outputDirectory>target/generated-test-sources/antlr3</outputDirectory>
|
||||
<includes>
|
||||
<include>org/jf/smali/expectedTokensTestGrammar.g</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>org.jf.smali.main</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>1.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add generated test sources</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>add-test-source</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>target/generated-test-sources</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.github.wvengen</groupId>
|
||||
<artifactId>proguard-maven-plugin</artifactId>
|
||||
<version>2.0.5</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>proguard</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<proguardVersion>4.8</proguardVersion>
|
||||
<obfuscate>false</obfuscate>
|
||||
<includeDependency>false</includeDependency>
|
||||
<injar>${project.build.finalName}-jar-with-dependencies.jar</injar>
|
||||
<outjar>${project.build.finalName}-jar-with-dependencies-small.jar</outjar>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
<options>
|
||||
<option>-dontoptimize</option> <!--optimization takes *forever* for smali-->
|
||||
<option>-keep public class org.jf.smali.main {
|
||||
public static void main(java.lang.String[]);
|
||||
}</option>
|
||||
<option>-keepclassmembers enum * {
|
||||
public static **[] values();
|
||||
public static ** valueOf(java.lang.String);
|
||||
}</option>
|
||||
<option>-dontwarn junit.**</option>
|
||||
<option>-dontnote junit.**</option>
|
||||
<option>-dontwarn org.junit.**</option>
|
||||
<option>-dontnote org.junit.**</option>
|
||||
<option>-dontwarn com.google.common.base.**</option>
|
||||
<option>-dontnote com.google.common.base.**</option>
|
||||
</options>
|
||||
<libs>
|
||||
<lib>${java.home}/lib/rt.jar</lib>
|
||||
</libs>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.sf.proguard</groupId>
|
||||
<artifactId>proguard-base</artifactId>
|
||||
<version>4.8</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr-runtime</artifactId>
|
||||
<version>3.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jf</groupId>
|
||||
<artifactId>dexlib</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jf</groupId>
|
||||
<artifactId>util</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-cli</groupId>
|
||||
<artifactId>commons-cli</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
Loading…
x
Reference in New Issue
Block a user