Skip to content

Commit

Permalink
update gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
af-margot committed Nov 9, 2020
1 parent bb08853 commit 943f207
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 120 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ android {
}

dependencies {
implementation 'com.appsflyer:af-android-sdk:5.4.4@aar'
implementation 'com.appsflyer:af-android-sdk:5.4.4'
compileOnly 'com.android.installreferrer:installreferrer:2.1'
compileOnly 'com.segment.analytics.android:analytics:4.+'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:1.10.19'
testImplementation 'com.segment.analytics.android:analytics-tests:4.+'
}

apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
apply from: file('publish.gradle')
63 changes: 63 additions & 0 deletions app/publish.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
apply plugin: 'maven'
apply plugin: 'signing'

afterEvaluate { project ->
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
pom.groupId = GROUP
pom.artifactId = POM_ARTIFACT_ID
pom.version = VERSION_NAME
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}
pom.project {
name POM_NAME
packaging POM_PACKAGING
description POM_DESCRIPTION
url POM_URL
scm {
url POM_SCM_URL
connection POM_SCM_CONNECTION
developerConnection POM_SCM_DEV_CONNECTION
}
licenses {
license {
name POM_LICENCE_NAME
url POM_LICENCE_URL
distribution POM_LICENCE_DIST
}
}
developers {
developer {
id POM_DEVELOPER_ID
name POM_DEVELOPER_NAME
}
}
}
}
}
}
signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
task androidJavadocs(type: Javadoc) {
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) { options.addStringOption('Xdoclint:none', '-quiet') }
}
}
}
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
archiveClassifier = 'javadoc'
from androidJavadocs.destinationDir
}
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.sourceFiles
}
artifacts { archives androidJavadocsJar }
}
23 changes: 14 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
mavenCentral()
Expand All @@ -8,19 +6,26 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.21.2"
}
}
apply plugin: 'io.codearte.nexus-staging'

def getRepositoryUsername() { return hasProperty('ossrhUsername') ? ossrhUsername : "" }

def getRepositoryPassword() { return hasProperty('ossrhPassword') ? ossrhPassword : "" }

nexusStaging {
packageGroup = GROUP // optional if packageGroup == project.getGroup()
username = getRepositoryUsername()
password = getRepositoryPassword()
delayBetweenRetriesInMillis = 30000
numberOfRetries = 120
}
allprojects {
repositories {
jcenter()
google()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
task clean(type: Delete) { delete rootProject.buildDir }
108 changes: 0 additions & 108 deletions gradle/gradle-mvn-push.gradle

This file was deleted.

2 changes: 1 addition & 1 deletion segmenttestapp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies {
implementation project(path: ':app')
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.appsflyer:af-android-sdk:5.4.4@aar'
implementation 'com.appsflyer:af-android-sdk:5.4.4'
//noinspection GradleDynamicVersion
implementation 'com.segment.analytics.android:analytics:4.+'
// compile 'com.appsflyer:segment-android-integration:5.4.4'
Expand Down

0 comments on commit 943f207

Please sign in to comment.