Skip to content

Commit

Permalink
build: add maven publish
Browse files Browse the repository at this point in the history
  • Loading branch information
skylot committed Dec 19, 2021
1 parent 01f4728 commit 4bd8e26
Show file tree
Hide file tree
Showing 14 changed files with 91 additions and 21 deletions.
9 changes: 0 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ println("jadx version: ${jadxVersion}")
allprojects {
apply plugin: 'java'
apply plugin: 'checkstyle'
apply plugin: 'maven-publish'

version = jadxVersion

Expand All @@ -27,14 +26,6 @@ allprojects {
}
}

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

dependencies {
implementation 'org.slf4j:slf4j-api:1.7.32'
compileOnly 'org.jetbrains:annotations:23.0.0'
Expand Down
3 changes: 3 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins {
id 'groovy-gradle-plugin'
}
76 changes: 76 additions & 0 deletions buildSrc/src/main/groovy/jadx-library.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
}


group = 'io.github.skylot'
version = jadxVersion

java {
withJavadocJar()
withSourcesJar()
}

publishing {
publications {
mavenJava(MavenPublication) {
artifactId = project.name
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = project.name
description = 'Dex to Java decompiler'
url = 'https://github.com/skylot/jadx'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'skylot'
name = 'Skylot'
email = 'skylot@gmail.com'
url = 'https://github.com/skylot'
}
}
scm {
connection = 'scm:git:git://github.com/skylot/jadx.git'
developerConnection = 'scm:git:ssh://github.com:skylot/jadx.git'
url = 'https://github.com/skylot/jadx'
}
}
}
}
repositories {
maven {
def releasesRepoUrl = uri('https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/')
def snapshotsRepoUrl = uri('https://s01.oss.sonatype.org/content/repositories/snapshots/')
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = project.properties['ossrhUser'].toString()
password = project.properties['ossrhPassword'].toString()
}
}
}
}

signing {
sign publishing.publications.mavenJava
}

javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
2 changes: 1 addition & 1 deletion jadx-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'java-library'
id 'jadx-library'
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ private List<ArgType> consumeGenericArgs() {

/**
* Map of generic types names to extends classes.
* <p/>
* Example: "<T:Ljava/lang/Exception;:Ljava/lang/Object;>"
* <p>
* Example: "&lt;T:Ljava/lang/Exception;:Ljava/lang/Object;&gt;"
*/
@SuppressWarnings("ConditionalBreakInInfiniteLoop")
public List<ArgType> consumeGenericTypeParameters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.io.IOException;

/**
* @author Ryszard Wiśniewski <brut.alll@gmail.com>
* @author Ryszard Wiśniewski "brut.alll@gmail.com"
*/
public abstract class DataInputDelegate implements DataInput {
protected final DataInput mDelegate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.io.InputStream;

/**
* @author Ryszard Wiśniewski <brut.alll@gmail.com>
* @author Ryszard Wiśniewski "brut.alll@gmail.com"
*/
public class ExtDataInput extends DataInputDelegate {
public ExtDataInput(InputStream in) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import jadx.core.utils.exceptions.JadxRuntimeException;

/**
* @author Ryszard Wiśniewski <brut.alll@gmail.com>
* @author Ryszard Wiśniewski "brut.alll@gmail.com"
*/
public class Res9patchStreamDecoder {

Expand Down
2 changes: 1 addition & 1 deletion jadx-plugins/jadx-dex-input/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'java-library'
id 'jadx-library'
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion jadx-plugins/jadx-java-convert/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'java-library'
id 'jadx-library'
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion jadx-plugins/jadx-java-input/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'java-library'
id 'jadx-library'
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion jadx-plugins/jadx-plugins-api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
plugins {
id 'java-library'
id 'jadx-library'
}
2 changes: 1 addition & 1 deletion jadx-plugins/jadx-raung-input/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'java-library'
id 'jadx-library'
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion jadx-plugins/jadx-smali-input/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'java-library'
id 'jadx-library'
}

dependencies {
Expand Down

0 comments on commit 4bd8e26

Please sign in to comment.