unify smali/baksmali/apktool properties into one folder

This commit is contained in:
Connor Tumbleson 2012-09-20 19:28:24 -05:00
parent 7e6ad41830
commit dd881e21d1
7 changed files with 32 additions and 34 deletions

10
.gitignore vendored
View File

@ -9,3 +9,13 @@ brut.apktool/apktool-lib/build*
brut.apktool/build*
build*
*~
/brut.apktool/nbproject/private/
/brut.apktool.smali/baksmali/nbproject/private/
/brut.apktool.smali/dexlib/nbproject/private/
/brut.apktool.smali/nbproject/private/
/nbproject/private/
/brut.apktool.smali/smali/nbproject/private/
/brut.apktool.smali/util/nbproject/private/
/brut.apktool/apktool-lib/nbproject/private/
/brut.apktool/apktool-cli/nbproject/private/
*.kate-swp

View File

@ -39,8 +39,7 @@ public class ApktoolProperties {
}
private static void loadProps() {
InputStream in = ApktoolProperties.class
.getResourceAsStream("apktool.properties");
InputStream in = main.class.getResourceAsStream("/properties/apktool.properties");
sProps = new Properties();
try {
sProps.load(in);
@ -49,7 +48,7 @@ public class ApktoolProperties {
LOGGER.warning("Can't load properties.");
}
InputStream templateStream = baksmali.class.getClassLoader().getResourceAsStream("properties/baksmali.properties");
InputStream templateStream = main.class.getClassLoader().getResourceAsStream("/properties/baksmali.properties");
Properties properties = new Properties();
String version = "(unknown)";
try {
@ -58,7 +57,7 @@ public class ApktoolProperties {
} catch (IOException ex) {
}
sProps.put("baksmaliVersion", version);
templateStream = main.class.getClassLoader().getResourceAsStream("smali.properties");
templateStream = main.class.getClassLoader().getResourceAsStream("/properties/smali.properties");
properties = new Properties();
version = "(unknown)";
try {

View File

@ -417,8 +417,7 @@ final public class AndrolibResources {
InputStream in = null;
OutputStream out = null;
try {
in = AndrolibResources.class.getResourceAsStream(
"/brut/androlib/android-framework.jar");
in = AndrolibResources.class.getResourceAsStream("brut/androlib/android-framework.jar");
out = new FileOutputStream(apk);
IOUtils.copy(in, out);
return apk;

View File

@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package brut.androlib;
import brut.androlib.res.util.ExtFile;

View File

@ -1,5 +1,6 @@
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'license'
repositories {
mavenCentral()
@ -12,11 +13,28 @@ task wrapper(type: Wrapper) {
gradleVersion = '1.2'
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.5.0'
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'idea'
gradle.taskGraph.whenReady {
ext.version = '1.5.1'
jar {
}
}
repositories {
mavenCentral()
}
@ -61,33 +79,6 @@ subprojects {
}
}
project(':brut.apktool:apktool-lib') {
ext.baseVersion = '1.5.1'
ext.jarVersion = baseVersion
def versionSuffix
try {
def git = org.eclipse.jgit.api.Git.open(file('.'))
def head = git.getRepository().getRef("HEAD")
versionSuffix = head.getObjectId().abbreviate(8).name()
if (!git.status().call().clean) {
versionSuffix += '-dirty'
}
} catch (Exception) {
// In case we can't get the commit for some reason,
// just use -dev
versionSuffix = 'SNAPSHOT'
}
version = baseVersion + '-' + versionSuffix
// use <version>-dev for the jar name, rather than the
// full commit+dirty string
jarVersion = baseVersion + '-dev'
jar {
version = jarVersion
}
dependencies {
compile ("junit:junit:4.10") {
exclude(module: 'hamcrest-core')