11apply plugin : ' com.android.library'
22apply plugin : ' com.jfrog.artifactory'
33apply plugin : ' maven-publish'
4-
5- def COMPILE_SDK_VERSION = 27
6- def BUILD_TOOLS_VERSION = ' 27.0.2'
7- def SUPPORT_LIBRARY_VERSION = ' 27.0.2'
4+ apply from : " ../common-methods.gradle"
85
96allprojects {
107 gradle. projectsEvaluated {
@@ -15,42 +12,23 @@ allprojects {
1512}
1613
1714dependencies {
18- // Compile dependencies will be added as dependency in pom file.
19- api " com.android.support:support-v4:[22.0.0,${ SUPPORT_LIBRARY_VERSION} ]"
20- api " com.android.support:appcompat-v7:[22.0.0,${ SUPPORT_LIBRARY_VERSION} ]"
21-
22- // Provided dependencies are optional dependencies and will not show up in pom file.
23- compileOnly(' com.google.android.gms:play-services-gcm:[8.3.0,)' ) {
24- exclude module : ' support-v4'
25- }
26- compileOnly(' com.google.firebase:firebase-messaging:[10.0.0,)' ) {
27- exclude module : ' support-v4'
28- }
29- compileOnly(' com.google.android.gms:play-services-location:[10.0.0,)' ) {
30- exclude module : ' support-v4'
31- }
15+ debugApi project(' :AndroidSDKCore' )
16+ releaseApi project(' :AndroidSDKCore' )
3217}
3318
3419android {
3520 compileSdkVersion COMPILE_SDK_VERSION
3621 buildToolsVersion BUILD_TOOLS_VERSION
37- useLibrary ' org.apache.http.legacy'
3822// publishNonDefault true
3923
4024 defaultConfig {
41- consumerProguardFiles ' consumer-proguard-rules.pro '
25+ consumerProguardFiles CONSUMER_PROGUARD_FILES
4226 }
4327
4428 buildTypes {
4529 release {
4630 minifyEnabled true
47- proguardFiles ' proguard-rules.pro'
48-
49- }
50- buildTypes. each {
51- def packageIdentifier = ' \" ' + (System . getenv(" LEANPLUM_PACKAGE_IDENTIFIER" ) ?: " s" ) +
52- ' \" '
53- it. buildConfigField ' String' , ' LEANPLUM_PACKAGE_IDENTIFIER' , packageIdentifier
31+ proguardFiles PROGUARD_FILES
5432 }
5533 }
5634
@@ -78,100 +56,4 @@ android {
7856 release. setRoot(' build-types/release' )
7957 }
8058}
81-
82- task generateJavadoc (type : Javadoc ) {
83- exclude ' com/leanplum/internal'
84- exclude ' com/leanplum/messagetemplates'
85- exclude ' com/leanplum/utils'
86- exclude ' com/leanplum/views'
87- source = android. sourceSets. main. java. srcDirs
88- classpath + = project. files(android. getBootClasspath(). join(File . pathSeparator))
89- destinationDir = file(" ./javadoc/" )
90- failOnError false
91- }
92-
93- def libraryGroupId = ' com.leanplum'
94- def libraryArtifactId = ' Leanplum'
95- def libraryVersion = " $System . env . ANDROID_VERSION_STRING "
96-
97- task makeJar (type : Copy ) {
98- from(' build/intermediates/bundles/release/' )
99- into(' build/outputs/jar/' )
100- include(' classes.jar' )
101- rename(' classes.jar' , ' AndroidSDK-release.jar' )
102- }
103-
104- publishing {
105- publications {
106- aar(MavenPublication ) {
107- groupId libraryGroupId
108- version libraryVersion
109- artifactId libraryArtifactId
110-
111- artifact(" $buildDir /outputs/aar/AndroidSDK-release.aar" )
112-
113- // The publication doesn't know about our dependencies,
114- // so we have to manually add them to the pom.
115- pom. withXml {
116- def dependenciesNode = asNode(). appendNode(' dependencies' )
117-
118- // Iterate over the compile dependencies (we don't want the test ones),
119- // adding a <dependency> node for each.
120- configurations. api. allDependencies. each {
121- if (it. group != null && it. name != null ) {
122- def dependencyNode = dependenciesNode. appendNode(' dependency' )
123- dependencyNode. appendNode(' groupId' , it. group)
124- dependencyNode. appendNode(' artifactId' , it. name)
125- dependencyNode. appendNode(' version' , it. version)
126- }
127- }
128- }
129- }
130- jar(MavenPublication ) {
131- groupId libraryGroupId
132- version libraryVersion
133- artifactId libraryArtifactId
134-
135- artifact(" $buildDir /outputs/jar/AndroidSDK-release.jar" )
136-
137- // The publication doesn't know about our dependencies,
138- // so we have to manually add them to the pom.
139- pom. withXml {
140- asNode(). appendNode(' packaging' , ' aar' ) // Default to aar packaging.
141- def dependenciesNode = asNode(). appendNode(' dependencies' )
142-
143- // Iterate over the compile dependencies (we don't want the test ones),
144- // adding a <dependency> node for each.
145- configurations. api. allDependencies. each {
146- if (it. group != null && it. name != null ) {
147- def dependencyNode = dependenciesNode. appendNode(' dependency' )
148- dependencyNode. appendNode(' groupId' , it. group)
149- dependencyNode. appendNode(' artifactId' , it. name)
150- dependencyNode. appendNode(' version' , it. version)
151- }
152- }
153- }
154- }
155- }
156- }
157-
158- if (project. hasProperty(' artifactoryUsername' ) && project. hasProperty(' artifactoryPassword' )) {
159- artifactory {
160- contextUrl = ' http://artifactory-upload.leanplum.com'
161- publish {
162- repository {
163- repoKey = ' libs-snapshot-local'
164-
165- username = artifactoryUsername
166- password = artifactoryPassword
167- }
168- defaults {
169- publications(' aar' , ' jar' )
170- publishArtifacts = true
171-
172- properties = [' qa.level' : ' basic' , ' q.os' : ' android' , ' dev.team' : ' core' ]
173- publishPom = true
174- }
175- }
176- }
177- }
59+ publishing_task(LEANPLUM_ARTIFACT_ID , ' AndroidSDK' )
0 commit comments