diff --git a/android/build.gradle b/android/build.gradle index a8d9bdca..fceb093b 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,4 @@ apply plugin: 'com.android.library' -apply plugin: 'maven' apply plugin: 'maven-publish' buildscript { @@ -23,7 +22,6 @@ android { versionName "0.0.3" consumerProguardFiles 'proguard-rules.pro' testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } buildTypes { @@ -34,18 +32,27 @@ android { } } +task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' +} + +artifacts { + archives sourcesJar +} + publishing { publications { android(MavenPublication) { groupId 'com.msopentech.thali.toronionproxy.android' artifactId 'android' version '0.0.3' - artifact(sourceJar) + artifact(sourcesJar) artifact("$buildDir/outputs/aar/android-release.aar") pom.withXml { def dependenciesNode = asNode().appendNode('dependencies') - //Iterate over the compile dependencies (we don't want the test ones), adding a node for each - configurations.compile.allDependencies.each { + //Iterate over the implementation dependencies (we don't want the test ones), adding a node for each + configurations.implementation.allDependencies.each { if(it.group != null && (it.name != null || "unspecified".equals(it.name)) && it.version != null) { def dependencyNode = dependenciesNode.appendNode('dependency') @@ -59,11 +66,6 @@ publishing { } } -task sourceJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier "source" -} - dependencies { implementation project(':universal') implementation 'net.freehaven.tor.control:jtorctl:0.2' @@ -98,12 +100,3 @@ task copyPluggableTransports(type: Copy) { gradle.projectsEvaluated { preBuild.dependsOn(copyPluggableTransports) } - -task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' -} - -artifacts { - archives sourcesJar -} diff --git a/android_tor_installer/build.gradle b/android_tor_installer/build.gradle index 554fd496..18f17b52 100644 --- a/android_tor_installer/build.gradle +++ b/android_tor_installer/build.gradle @@ -1,5 +1,4 @@ apply plugin: 'com.android.library' -apply plugin: 'maven' apply plugin: 'maven-publish' buildscript { diff --git a/build.gradle b/build.gradle index 43b9e133..56a5a7fe 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ -allprojects { - apply plugin: 'maven' +allprojects { + apply plugin: 'maven-publish' group = 'com.msopentech.thali' version = '0.0.3' } @@ -12,7 +12,5 @@ subprojects { } } -evaluationDependsOn ":universal" -evaluationDependsOn ":java" - - +evaluationDependsOn(":universal") +evaluationDependsOn(":java") diff --git a/gradle.properties b/gradle.properties index 7e9d7bde..d2b62724 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ # Configure Android Gradle Plugin Version -androidplugin=3.2.1 +androidplugin=7.0.2 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 290541c7..e750102e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/java/build.gradle b/java/build.gradle index 264d09f1..db104b9d 100644 --- a/java/build.gradle +++ b/java/build.gradle @@ -1,5 +1,5 @@ apply plugin: 'java' -apply plugin: 'maven' +apply plugin: 'maven-publish' sourceCompatibility = 1.8 targetCompatibility = 1.8 diff --git a/universal/build.gradle b/universal/build.gradle index 43812d9c..8a86800f 100644 --- a/universal/build.gradle +++ b/universal/build.gradle @@ -1,5 +1,5 @@ apply plugin: 'java' -apply plugin: 'maven' +apply plugin: 'maven-publish' sourceCompatibility = 1.8 targetCompatibility = 1.8 @@ -14,7 +14,7 @@ repositories { dependencies { implementation 'org.slf4j:slf4j-api:1.7.25' implementation 'net.freehaven.tor.control:jtorctl:0.2' - testCompile group: 'junit', name: 'junit', version: '4.12' + testImplementation group: 'junit', name: 'junit', version: '4.12' } task sourcesJar(type:Jar){ @@ -25,3 +25,12 @@ task sourcesJar(type:Jar){ artifacts { archives sourcesJar } + +// Define publication for maven-publish plugin +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + } + } +}