Skip to content

Commit

Permalink
add publish.gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaviva committed May 25, 2021
1 parent f849825 commit 5848f79
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 18 deletions.
7 changes: 3 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ buildscript {
google()
mavenCentral()
jcenter()
mavenLocal()

}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// bintray with Gradle 6.0+ https://github.com/panpf/bintray-publish
classpath 'com.github.panpf.bintray-publish:bintray-publish:1.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

Expand All @@ -24,6 +22,7 @@ allprojects {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
mavenLocal()
}

tasks.withType(Javadoc).all {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ kotlin.code.style=official
# bintray upload
USER_ORG=vitaviva
ARTIFACT_GROUP=com.github.fragivity
ARTIFACT_VERSION=0.2.6.2
ARTIFACT_VERSION=0.2.6.5
WEB_SITE=https://github.com/vitaviva/fragivity
10 changes: 0 additions & 10 deletions gradle/bintray.gradle

This file was deleted.

22 changes: 22 additions & 0 deletions gradle/publish.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apply plugin: 'maven-publish'


afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
groupId = ARTIFACT_GROUP
artifactId = ARTIFACT_NAME
version = ARTIFACT_VERSION
}

debug(MavenPublication) {
from components.debug
groupId = ARTIFACT_GROUP
artifactId = ARTIFACT_NAME
version = ARTIFACT_VERSION
}
}
}
}
16 changes: 15 additions & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,18 @@ configurations.all {
}
}

apply from: rootProject.file("gradle/bintray.gradle")

apply from: rootProject.file("gradle/publish.gradle")



//publish {
// userOrg = USER_ORG
// groupId = ARTIFACT_GROUP
// artifactId = ARTIFACT_NAME
// publishVersion = ARTIFACT_VERSION
// desc = 'Use Fragment like Activity'
// website = 'https://github.com/vitaviva/fragivity'
//}

//apply from: rootProject.file("gradle/bintray.gradle")
14 changes: 12 additions & 2 deletions processor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apply plugin: 'java-library'
apply plugin: 'kotlin'
apply plugin: 'kotlin-kapt'


dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
Expand All @@ -16,4 +15,15 @@ dependencies {
sourceCompatibility = 1.7
targetCompatibility = 1.7

apply from: rootProject.file("gradle/bintray.gradle")

apply plugin: 'maven'
group = ARTIFACT_GROUP

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}

artifacts {
archives sourcesJar
}

0 comments on commit 5848f79

Please sign in to comment.