Skip to content

Commit

Permalink
fix: use maven-publish for JitPack and other fixes (PR skylot#1242)
Browse files Browse the repository at this point in the history
* Update dependencies
* Fix spaces in file paths
* Update Gradle for LGTM
* Update spotless
* Fix Jitpack

Co-authored-by: Skylot <skylot@gmail.com>
  • Loading branch information
ThexXTURBOXx and skylot authored Aug 27, 2021
1 parent 8d5f22e commit f681c89
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 15 deletions.
17 changes: 13 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'com.github.ben-manes.versions' version '0.39.0'
id "com.diffplug.spotless" version "5.12.5"
id 'com.diffplug.spotless' version '5.14.3'
}

ext.jadxVersion = System.getenv('JADX_VERSION') ?: "dev"
Expand All @@ -10,6 +10,7 @@ println("jadx version: ${jadxVersion}")
allprojects {
apply plugin: 'java'
apply plugin: 'checkstyle'
apply plugin: 'maven-publish'

version = jadxVersion

Expand All @@ -26,20 +27,28 @@ allprojects {
}
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}

dependencies {
implementation 'org.slf4j:slf4j-api:1.7.32'
compileOnly 'org.jetbrains:annotations:21.0.1'
compileOnly 'org.jetbrains:annotations:22.0.0'

testImplementation 'ch.qos.logback:logback-classic:1.2.5'
testImplementation 'org.hamcrest:hamcrest-library:2.2'
testImplementation 'org.mockito:mockito-core:3.11.2'
testImplementation 'org.mockito:mockito-core:3.12.1'
testImplementation 'org.assertj:assertj-core:3.20.2'

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.2'

testImplementation 'org.eclipse.jdt.core.compiler:ecj:4.6.1'
testCompileOnly 'org.jetbrains:annotations:21.0.1'
testCompileOnly 'org.jetbrains:annotations:22.0.0'
}

test {
Expand Down
12 changes: 7 additions & 5 deletions jadx-cli/src/test/java/jadx/cli/TestInput.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.nio.file.LinkOption;
import java.nio.file.Path;
import java.nio.file.PathMatcher;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
Expand Down Expand Up @@ -44,19 +45,20 @@ public void testMultipleInput() throws Exception {
}

private void decompile(String tmpDirName, String... inputSamples) throws URISyntaxException, IOException {
StringBuilder args = new StringBuilder();
List<String> args = new ArrayList<>();
Path tempDir = FileUtils.createTempDir(tmpDirName);
args.append("-v");
args.append(" -d ").append(tempDir.toAbsolutePath());
args.add("-v");
args.add("-d");
args.add(tempDir.toAbsolutePath().toString());

for (String inputSample : inputSamples) {
URL resource = getClass().getClassLoader().getResource(inputSample);
assertThat(resource).isNotNull();
String sampleFile = resource.toURI().getRawPath();
args.append(' ').append(sampleFile);
args.add(sampleFile);
}

int result = JadxCLI.execute(args.toString().split(" "));
int result = JadxCLI.execute(args.toArray(new String[0]));
assertThat(result).isEqualTo(0);
List<Path> resultJavaFiles = collectJavaFilesInDir(tempDir);
assertThat(resultJavaFiles).isNotEmpty();
Expand Down
2 changes: 1 addition & 1 deletion jadx-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
dependencies {
api(project(':jadx-plugins:jadx-plugins-api'))

implementation 'com.google.code.gson:gson:2.8.7'
implementation 'com.google.code.gson:gson:2.8.8'
implementation 'com.android.tools.build:aapt2-proto:4.2.1-7147631'

testImplementation 'org.apache.commons:commons-lang3:3.12.0'
Expand Down
8 changes: 4 additions & 4 deletions jadx-gui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ dependencies {
implementation files('libs/jfontchooser-1.0.5.jar')
implementation 'hu.kazocsaba:image-viewer:1.2.3'

implementation 'com.formdev:flatlaf:1.4'
implementation 'com.formdev:flatlaf-intellij-themes:1.4'
implementation 'com.formdev:flatlaf-extras:1.4'
implementation 'com.formdev:flatlaf:1.5'
implementation 'com.formdev:flatlaf-intellij-themes:1.5'
implementation 'com.formdev:flatlaf-extras:1.5'
implementation 'com.formdev:svgSalamander:1.1.2.4'
implementation 'org.reflections:reflections:0.9.12'

implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.google.code.gson:gson:2.8.8'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'org.apache.commons:commons-text:1.9'

Expand Down
2 changes: 1 addition & 1 deletion lgtm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ extraction:
java:
index:
gradle:
version: 6.1.1
version: 7.0.2
build_command: ./gradlew clean build
java_version: 11
properties_files: true
Expand Down

0 comments on commit f681c89

Please sign in to comment.