Skip to content

Commit 8548af6

Browse files
committed
add maven-publish plugin
1 parent d11578f commit 8548af6

3 files changed

Lines changed: 34 additions & 15 deletions

File tree

build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@ buildscript {
77
jcenter()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.5.2'
10+
classpath 'com.android.tools.build:gradle:4.1.2'
1111
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12-
classpath 'com.novoda:bintray-release:0.9.1'
13-
1412
// NOTE: Do not place your application dependencies here; they belong
1513
// in the individual module build.gradle files
1614
}
1715
}
1816

17+
plugins {
18+
id 'maven-publish'
19+
}
20+
1921
allprojects {
2022
repositories {
2123
google()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

imageviewer/build.gradle

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
3-
apply plugin: 'com.novoda.bintray-release'
3+
apply plugin: 'maven-publish'
44

55
android {
66
compileSdkVersion 29
@@ -11,16 +11,31 @@ android {
1111
versionCode 1
1212
versionName "1.0"
1313
}
14-
}
1514

16-
publish {
17-
userOrg = 'troy379'
18-
groupId = 'com.github.stfalcon'
19-
artifactId = 'stfalcon-imageviewer'
20-
publishVersion = '1.0.1'
21-
desc = 'A customizable full-screen image viewer with shared image transition support, "pinch to zoom" and "swipe to dismiss" gestures.'
22-
uploadName='StfalconImageViewer'
23-
website = 'https://github.com/stfalcon-studio/StfalconImageViewer'
15+
buildTypes {
16+
release {
17+
minifyEnabled false
18+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
19+
}
20+
}
21+
22+
afterEvaluate {
23+
publishing {
24+
publications {
25+
// Creates a Maven publication called "release".
26+
release(MavenPublication) {
27+
// Applies the component for the release build variant.
28+
from components.release
29+
30+
// You can then customize attributes of the publication as shown below.
31+
groupId = 'com.github.stfalcon'
32+
artifactId = 'stfalcon-imageviewer'
33+
version = '1.0.1'
34+
}
35+
}
36+
}
37+
}
38+
2439
}
2540

2641
dependencies {
@@ -32,6 +47,8 @@ dependencies {
3247

3348
repositories {
3449
maven { url "https://jitpack.io" }
50+
mavenCentral()
51+
google()
3552
}
3653

3754
// Avoid Kotlin docs error
@@ -43,4 +60,4 @@ tasks.withType(Javadoc) {
4360
task javadoc(type: Javadoc) {
4461
source = android.sourceSets.main.java.srcDirs
4562
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
46-
}
63+
}

0 commit comments

Comments
 (0)