-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae47ff1
commit c53a30d
Showing
3 changed files
with
109 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,30 @@ | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
buildscript { | ||
ext.kotlin_version = "1.4.21" | ||
ext.configs = [ | ||
versionName: "0.1.0", | ||
versionCode: 1, | ||
compileSdkVersion: 30, | ||
minSdkVersion: 24, | ||
targetSdkVersion: 30, | ||
groupId: "com.github.sasakitomohiro", | ||
artifactId: "rvtablayoutmediator", | ||
description: "RvTabLayoutMediator", | ||
siteUrl: "https://github.com/sasakitomohiro/RvTabLayoutMediator", | ||
gitUrl: "https://github.com/sasakitomohiro/RvTabLayoutMediator.git", | ||
developerId: "sasakitomohiro", | ||
developerName: "TomohiroSasaki", | ||
developerEmail: "[email protected]", | ||
licenseName: "The Apache Software License, Version 2.0", | ||
licenseUrl: "http://www.apache.org/licenses/LICENSE-2.0.txt" | ||
] | ||
repositories { | ||
google() | ||
mavenCentral() | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:7.0.0-rc01' | ||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10" | ||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
|
||
// NOTE: Do not place your application dependencies here; they belong | ||
// in the individual module build.gradle files | ||
|
@@ -15,4 +33,4 @@ buildscript { | |
|
||
task clean(type: Delete) { | ||
delete rootProject.buildDir | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
apply plugin: 'maven-publish' | ||
apply plugin: 'signing' | ||
|
||
def sonatypeUsername = rootProject.hasProperty('sonatypeUsername')? rootProject.sonatypeUsername : '' | ||
def sonatypePassword = rootProject.hasProperty('sonatypePassword')? rootProject.sonatypePassword : '' | ||
|
||
version configs.versionName | ||
group configs.groupId | ||
|
||
task sourcesJar(type: Jar) { | ||
archiveClassifier.set("sources") | ||
from android.sourceSets.getByName("main").java.srcDirs | ||
} | ||
|
||
task javadoc(type: Javadoc) { | ||
options.addStringOption('Xdoclint:none', '-quiet') | ||
source = android.sourceSets.getByName("main").java.srcDirs | ||
classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) | ||
excludes = ['**/*.kt'] | ||
} | ||
|
||
task javadocJar(type: Jar, dependsOn: javadoc) { | ||
archiveClassifier.set("javadoc") | ||
from javadoc.destinationDir | ||
} | ||
|
||
afterEvaluate { | ||
publishing { | ||
publications { | ||
release(MavenPublication) { | ||
artifactId = configs.artifactId | ||
from components.release | ||
artifact javadocJar | ||
artifact sourcesJar | ||
pom { | ||
name = configs.artifactId | ||
description = configs.description | ||
url = configs.siteUrl | ||
licenses { | ||
license { | ||
name = configs.licenseName | ||
url = configs.licenseUrl | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = configs.developerId | ||
name = configs.developerName | ||
email = configs.developerEmail | ||
} | ||
} | ||
scm { | ||
connection = configs.gitUrl | ||
developerConnection = configs.gitUrl | ||
url = configs.siteUrl | ||
} | ||
} | ||
} | ||
} | ||
repositories { | ||
maven { | ||
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2" | ||
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots" | ||
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl | ||
credentials { | ||
username = "${sonatypeUsername}" | ||
password = "${sonatypePassword}" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
sign publishing.publications | ||
} | ||
|
||
javadoc { | ||
if (JavaVersion.current().isJava9Compatible()) { | ||
options.addBooleanOption('html5', true) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters