@@ -30,7 +30,7 @@ buildscript {
3030 google()
3131 }
3232 dependencies {
33- classpath ' com.android.tools.build:gradle:7.2.1 '
33+ classpath ' com.android.tools.build:gradle:7.2.2 '
3434 classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version "
3535
3636 // NOTE: Do not place your application dependencies here; they belong
@@ -86,7 +86,7 @@ task clean(type: Delete) {
8686task cleanAllModules () {
8787 logger. info(" Running clean for all modules" )
8888 dependsOn(' :android-sdk:clean' , ' :event-handler:clean' ,
89- ' :user-profile:clean' , ' :shared:clean' , ' :datafile-handler:clean' )
89+ ' :user-profile:clean' , ' :shared:clean' , ' :datafile-handler:clean' , ' :odp:clean ' )
9090}
9191
9292task testAllModules () {
@@ -100,20 +100,21 @@ task testAllModulesTravis () {
100100 ' :event-handler:connectedAndroidTest' , ' :event-handler:test' ,
101101 ' :datafile-handler:connectedAndroidTest' , ' :datafile-handler:test' ,
102102 ' :user-profile:connectedAndroidTest' ,
103- ' :shared:connectedAndroidTest' )
103+ ' :shared:connectedAndroidTest' ,
104+ ' :odp:connectedAndroidTest' , ' :odp:test'
105+ )
104106}
105107
106108// Publish to MavenCentral
107109
108110task ship () {
109- dependsOn(' :android-sdk:ship' , ' :shared:ship' , ' :event-handler:ship' , ' :user-profile:ship' , ' :datafile-handler:ship' )
111+ dependsOn(' :android-sdk:ship' , ' :shared:ship' , ' :event-handler:ship' , ' :user-profile:ship' , ' :datafile-handler:ship' , ' :odp:ship ' )
110112}
111113
112114def publishedProjects = subprojects. findAll { it. name != ' test-app' }
113115configure(publishedProjects) {
114116 apply plugin : ' com.android.library'
115117 apply plugin : ' kotlin-android'
116- apply plugin : ' kotlin-android-extensions'
117118 apply plugin : ' maven-publish'
118119 apply plugin : ' signing'
119120
@@ -140,13 +141,17 @@ configure(publishedProjects) {
140141 artifactName = ' android-sdk-user-profile'
141142 docTitle = ' Optimizely X Android SDK: User Profile'
142143 break
144+ case ' odp' :
145+ artifactName = ' android-sdk-odp'
146+ docTitle = ' Optimizely X Android SDK: ODP'
147+ break
143148 default :
144149 return
145150 }
146151
147152 android. libraryVariants. all { variant ->
148153 task(" ${ variant.name} Javadoc" , type : Javadoc , dependsOn : " assemble${ variant.name.capitalize()} " ) {
149- source = variant. javaCompile . source
154+ source = variant. javaCompileProvider . get() . source
150155
151156 title = docTitle
152157
@@ -178,11 +183,20 @@ configure(publishedProjects) {
178183 android. libraryVariants. all { variant ->
179184 task(" ${ variant.name} SourcesJar" , type : Jar ) {
180185 classifier = ' sources'
181- from variant. javaCompile . source
186+ from variant. javaCompileProvider . get() . source
182187 }
183188 project. artifacts. add(" archives" , tasks[" ${ variant.name} SourcesJar" ]);
184189 }
185190
191+ android {
192+ publishing {
193+ singleVariant(" release" ) {
194+ withSourcesJar()
195+ withJavadocJar()
196+ }
197+ }
198+ }
199+
186200 afterEvaluate {
187201 publishing {
188202 publications {
@@ -196,8 +210,6 @@ configure(publishedProjects) {
196210 pom. description = ' The Android SDK for Optimizely Full Stack (feature flag management for product development teams)'
197211
198212 from components. release
199- artifact releaseSourcesJar
200- artifact releaseJavadocJar
201213 }
202214 }
203215 repositories {
@@ -232,11 +244,12 @@ configure(publishedProjects) {
232244 }
233245}
234246
235- project(' :android-sdk' ). ship. shouldRunAfter = [' :android-sdk:clean' , ' :datafile-handler:ship' , ' :event-handler:ship' , ' :user-profile:ship' ]
247+ project(' :android-sdk' ). ship. shouldRunAfter = [' :android-sdk:clean' , ' :datafile-handler:ship' , ' :event-handler:ship' , ' :user-profile:ship' , ' :odp:ship ' ]
236248project(' :datafile-handler' ). ship. shouldRunAfter = [' :datafile-handler:clean' , ' :shared:ship' ]
237249project(' :event-handler' ). ship. shouldRunAfter = [' :event-handler:clean' , ' :shared:ship' ]
238250project(' :shared' ). ship. shouldRunAfter = [' :shared:clean' ]
239251project(' :user-profile' ). ship. shouldRunAfter = [' :user-profile:clean' , ' :shared:ship' ]
252+ project(' :odp' ). ship. shouldRunAfter = [' :odp:clean' , ' :shared:ship' ]
240253
241254// standard POM format required by MavenCentral
242255
0 commit comments