Skip to content

Commit 09da90d

Browse files
committed
Publish content-view modules as libraries (#47)
1 parent 416d4c9 commit 09da90d

8 files changed

Lines changed: 64 additions & 24 deletions

File tree

content-link-api/content-link-api/build.gradle

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,10 @@ android {
3434
testOptions {
3535
unitTests.returnDefaultValues = true
3636
}
37-
38-
publishing {
39-
singleVariant("release") {
40-
// if you don't want sources/javadoc, remove these lines
41-
withSourcesJar()
42-
withJavadocJar()
43-
}
44-
}
4537
}
4638

4739
dependencies {
48-
implementation project(path: ':core:content-core')
40+
api project(path: ':core:content-core')
4941

5042
implementation "androidx.appcompat:appcompat:$versions.appcompat"
5143
implementation "androidx.core:core-ktx:$versions.androidKtx"

content-view/content-view-core/build.gradle

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'com.android.library'
33
id 'org.jetbrains.kotlin.android'
4+
id 'maven-publish'
45
}
56

67
android {
@@ -31,7 +32,7 @@ android {
3132
}
3233

3334
dependencies {
34-
implementation project(path: ':core:content-core')
35+
api project(path: ':core:content-core')
3536

3637
implementation "androidx.appcompat:appcompat:$versions.appcompat"
3738
implementation "androidx.core:core-ktx:$versions.androidKtx"
@@ -40,4 +41,17 @@ dependencies {
4041
testImplementation "junit:junit:$versions.junit4"
4142
androidTestImplementation "androidx.test.ext:junit:$versions.junitAndroidExt"
4243
androidTestImplementation "androidx.test.espresso:espresso-core:$versions.expresso"
44+
}
45+
46+
afterEvaluate {
47+
publishing {
48+
publications {
49+
release(MavenPublication) {
50+
from components.release
51+
groupId 'com.github.devgary'
52+
artifactId 'content-view-core'
53+
version = "$versions.libVersion"
54+
}
55+
}
56+
}
4357
}

content-view/content-view-image/build.gradle

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'com.android.library'
33
id 'org.jetbrains.kotlin.android'
4+
id 'maven-publish'
45
}
56

67
android {
@@ -36,8 +37,8 @@ android {
3637
}
3738

3839
dependencies {
39-
implementation project(path: ':core:content-core')
40-
implementation project(path: ':content-view:content-view-core')
40+
api project(path: ':core:content-core')
41+
api project(path: ':content-view:content-view-core')
4142

4243
implementation "androidx.appcompat:appcompat:$versions.appcompat"
4344
implementation "androidx.core:core-ktx:$versions.androidKtx"
@@ -50,4 +51,17 @@ dependencies {
5051
testImplementation "junit:junit:$versions.junit4"
5152
androidTestImplementation "androidx.test.ext:junit:$versions.junitAndroidExt"
5253
androidTestImplementation "androidx.test.espresso:espresso-core:$versions.expresso"
54+
}
55+
56+
afterEvaluate {
57+
publishing {
58+
publications {
59+
release(MavenPublication) {
60+
from components.release
61+
groupId 'com.github.devgary'
62+
artifactId 'content-view-image'
63+
version = "$versions.libVersion"
64+
}
65+
}
66+
}
5367
}

content-view/content-view-video/build.gradle

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'com.android.library'
33
id 'org.jetbrains.kotlin.android'
4+
id 'maven-publish'
45
}
56

67
android {
@@ -36,8 +37,8 @@ android {
3637
}
3738

3839
dependencies {
39-
implementation project(path: ':core:content-core')
40-
implementation project(path: ':content-view:content-view-core')
40+
api project(path: ':core:content-core')
41+
api project(path: ':content-view:content-view-core')
4142

4243
implementation "androidx.appcompat:appcompat:$versions.appcompat"
4344
implementation "androidx.core:core-ktx:$versions.androidKtx"
@@ -51,4 +52,17 @@ dependencies {
5152
testImplementation "junit:junit:$versions.junit4"
5253
androidTestImplementation "androidx.test.ext:junit:$versions.junitAndroidExt"
5354
androidTestImplementation "androidx.test.espresso:espresso-core:$versions.expresso"
55+
}
56+
57+
afterEvaluate {
58+
publishing {
59+
publications {
60+
release(MavenPublication) {
61+
from components.release
62+
groupId 'com.github.devgary'
63+
artifactId 'content-view-video'
64+
version = "$versions.libVersion"
65+
}
66+
}
67+
}
5468
}

content-view/content-view/build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'com.android.library'
33
id 'org.jetbrains.kotlin.android'
4+
id 'maven-publish'
45
}
56

67
android {
@@ -49,4 +50,17 @@ dependencies {
4950
androidTestImplementation "androidx.test.ext:junit:$versions.junitAndroidExt"
5051
androidTestImplementation "androidx.test.espresso:espresso-core:$versions.expresso"
5152
androidTestImplementation project(path: ':core:test-android-core')
53+
}
54+
55+
afterEvaluate {
56+
publishing {
57+
publications {
58+
release(MavenPublication) {
59+
from components.release
60+
groupId 'com.github.devgary'
61+
artifactId 'content-view'
62+
version = "$versions.libVersion"
63+
}
64+
}
65+
}
5266
}

core/content-core/build.gradle

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@ android {
2929
kotlinOptions {
3030
jvmTarget = '1.8'
3131
}
32-
33-
publishing {
34-
singleVariant("release") {
35-
// if you don't want sources/javadoc, remove these lines
36-
withSourcesJar()
37-
withJavadocJar()
38-
}
39-
}
4032
}
4133

4234
dependencies {

demo/src/main/java/com/devgary/contentviewdemo/DemoActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class DemoActivity : AppCompatActivity() {
2727
object : BaseContentLinkHandler() {
2828
override fun provideContentHandlers(): List<ContentLinkHandler> {
2929
return listOf(
30-
com.devgary.contentlinkapi.handlers.gfycat.GfycatContentLinkHandler(
30+
GfycatContentLinkHandler(
3131
clientId = BuildConfig.GFYCAT_CLIENT_ID,
3232
clientSecret = BuildConfig.GFYCAT_CLIENT_SECRET
3333
),

versions.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ext.versions = [
33
targetSdk: 33,
44
compileSdk: 33,
55

6-
libVersion : "0.1.1",
6+
libVersion : "0.1.2",
77

88
ktReflect : '1.7.10',
99

0 commit comments

Comments
 (0)