Skip to content

Commit

Permalink
Prepare version 3.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWharton committed Mar 5, 2018
1 parent 55fb9e4 commit b5e4870
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 135 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,16 @@
Change Log
==========

Version 3.0.0 *(2018-03-05)*
----------------------------

* New: `dex-fields-list` command for listing field references.
* New: Added `DexFields` and `DexField` types for listing field references.
* Fix: Ignore `META-INF` contents.

Note: The dx and dex dependencies are no longer shadowed in the jar dependency.


Version 2.0.0 *(2017-10-12)*
----------------------------

Expand Down
27 changes: 20 additions & 7 deletions README.md
@@ -1,11 +1,11 @@
Dex Method List
===============
Dex Method/Field List
=====================

A simple utility which lists all method references in an `.apk`, `.aar`, `.dex`, `.jar`, and/or
`.class` files (and any combination of those).
A simple utility which lists all method or field references in an `.apk`, `.aar`, `.dex`, `.jar`,
and/or `.class` files (and any combination of those).

Build by calling `./gradlew clean assemble`. Run `./build/dex-method-list` by passing in one or
more arguments or by piping data through stdin.
Build by calling `./gradlew clean assemble`. Run `./build/dex-method-list` or
`./build/dex-field-list` by passing in one or more arguments or by piping data through stdin.

For example:
```
Expand Down Expand Up @@ -63,13 +63,26 @@ com.google.common.base.Absent asSet() → Set
com.google.common.base.Absent equals(Object) → boolean
com.google.common.base.Absent get() → Object
com.google.common.base.Absent hashCode() → int
$ ./build/dex-field-list src/test/resources/types.dex
Types valueBoolean: boolean
Types valueByte: byte
Types valueChar: char
Types valueDouble: double
Types valueFloat: float
Types valueInt: int
Types valueLong: long
Types valueShort: short
Types valueString: String
Types valueStringArray: String[]
```

Use the `--hide-synthetic-numbers` argument to remove number suffix from synthetic accessor
methods. This is useful to prevent noise when `diff`ing output.

You can also use this tool as a library. Add a dependency on
`com.jakewharton.dex:dex-method-list:2.0.0` and use the `DexMethods.list` methods.
`com.jakewharton.dex:dex-method-list:3.0.0` and use the `DexMethods.list` or `DexFields.list`
methods.


License
Expand Down
54 changes: 11 additions & 43 deletions build.gradle
Expand Up @@ -6,7 +6,6 @@ buildscript {
dependencies {
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.30'
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:0.9.16'
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
}
}

Expand All @@ -15,11 +14,13 @@ apply plugin: 'kotlin'
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'com.github.johnrengelman.shadow'

sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6

group = 'com.jakewharton.dex'
version = '3.0.0'

repositories {
mavenCentral()
}
Expand All @@ -28,7 +29,6 @@ dependencies {
compile 'com.jakewharton.android.repackaged:libcore-dex:7.1.0_r7'
compile 'com.jakewharton.android.repackaged:dalvik-dx:7.1.0_r7'
compile 'org.jetbrains.kotlin:kotlin-stdlib:1.2.30'
shadow 'org.jetbrains.kotlin:kotlin-stdlib:1.2.30'
testCompile 'junit:junit:4.12'
testCompile 'com.google.guava:guava:19.0'
testCompile 'com.google.truth:truth:0.28'
Expand All @@ -39,15 +39,6 @@ dokka {
outputDirectory "$buildDir/javadoc"
}

shadowJar {
classifier = ''
relocate 'com.android', 'com.jakewharton.dex.internal.android'

dependencies {
include(dependency('com.jakewharton.android.repackaged:.*'))
}
}

task javadocJar(type: Jar, dependsOn: 'dokka') {
classifier 'javadoc'
from "$buildDir/javadoc"
Expand Down Expand Up @@ -133,20 +124,13 @@ task copyFieldsMethods(type: Copy, dependsOn: binaryFieldsJar) {
}
assemble.dependsOn(copyFieldsMethods)

configurations.runtime.artifacts.removeAll { it.archiveTask.is jar }
tasks.getByName('jar').enabled = false

artifacts {
runtime shadowJar
shadow sourcesJar
shadow javadocJar
shadow file: binaryMethodsFile, name: 'binary', type: 'jar', builtBy: binaryMethodsJar, classifier: 'binary-methods'
shadow file: binaryFieldsFile, name: 'binary', type: 'jar', builtBy: binaryFieldsJar, classifier: 'binary-fields'
archives sourcesJar
archives javadocJar
archives file: binaryMethodsFile, name: 'binary', type: 'jar', builtBy: binaryMethodsJar, classifier: 'binary-methods'
archives file: binaryFieldsFile, name: 'binary', type: 'jar', builtBy: binaryFieldsJar, classifier: 'binary-fields'
}

group = 'com.jakewharton.dex'
version = '3.0.0-SNAPSHOT'

def isReleaseBuild() {
return version.contains("SNAPSHOT") == false
}
Expand All @@ -161,26 +145,10 @@ def getRepositoryPassword() {

signing {
required { isReleaseBuild() && gradle.taskGraph.hasTask('uploadArchives') }
sign configurations.shadow
}

install {
configuration = configurations.shadow
repositories {
mavenInstaller {
pom.scopeMappings.mappings.remove(project.configurations.compile)
pom.scopeMappings.mappings.remove(project.configurations.runtime)
pom.scopeMappings.addMapping(MavenPlugin.RUNTIME_PRIORITY, project.configurations.shadow, Conf2ScopeMappingContainer.RUNTIME)
}
}
sign configurations.archives
}

// Make sure binaries are signed before attempting to upload.
tasks.getByName('uploadShadow').dependsOn('signShadow')

task uploadArchives(dependsOn: 'uploadShadow')

uploadShadow {
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
Expand All @@ -193,9 +161,9 @@ uploadShadow {
}

pom.project {
name 'Dex Method List'
name 'Dex Method/Field List'
packaging 'jar'
description 'A simple utility which lists all method references in a dex file.'
description 'A simple utility which lists all method or field references in a dex file.'
url 'https://github.com/JakeWharton/dex-method-list'

scm {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
168 changes: 84 additions & 84 deletions gradlew.bat
@@ -1,84 +1,84 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega

0 comments on commit b5e4870

Please sign in to comment.