-
Notifications
You must be signed in to change notification settings - Fork 50
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
26aa623
commit 7d57fc4
Showing
5 changed files
with
151 additions
and
46 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 |
---|---|---|
|
@@ -2,64 +2,44 @@ apply plugin: 'com.android.library' | |
apply plugin: 'kotlin-android' | ||
|
||
ext { | ||
bintrayRepo = 'maven' | ||
bintrayName = 'MaskedEditText' | ||
|
||
publishedGroupId = 'com.vicmikhailau' | ||
libraryName = 'MaskedEditText' | ||
artifact = 'MaskedEditText' | ||
|
||
libraryDescription = 'Add a mask to EditText' | ||
|
||
siteUrl = 'https://github.com/VicMikhailau/MaskedEditText' | ||
gitUrl = 'https://github.com/VicMikhailau/MaskedEditText.git' | ||
|
||
libraryVersion = '3.1.1' | ||
|
||
developerId = 'VicMikhailau' | ||
developerName = 'Vic Mikhailau' | ||
developerEmail = '[email protected]' | ||
|
||
licenseName = 'The Apache Software License, Version 2.0' | ||
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
allLicenses = ["Apache-2.0"] | ||
PUBLISH_GROUP_ID = 'io.github.vicmikhailau' | ||
PUBLISH_VERSION = '4.0.5' | ||
PUBLISH_ARTIFACT_ID = 'MaskedEditText' | ||
} | ||
apply from: "${rootProject.projectDir}/scripts/publish-mavencentral.gradle" | ||
|
||
android { | ||
compileSdkVersion 30 | ||
|
||
defaultConfig { | ||
minSdkVersion 14 | ||
targetSdkVersion 30 | ||
versionCode 10 | ||
versionName "3.1.1" | ||
versionCode 15 | ||
versionName "4.0.5" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
tasks.withType(Javadoc).all { | ||
excludes = ['**/*.kt'] | ||
sourceSets { | ||
all { | ||
it.java.srcDir "src/$it.name/kotlin" | ||
} | ||
} | ||
} | ||
|
||
|
||
ext { | ||
androidx_appcompat = '1.2.0' | ||
androidx_core_ktx = '1.3.2' | ||
} | ||
|
||
dependencies { | ||
api fileTree(dir: 'libs', include: ['*.jar']) | ||
api "androidx.appcompat:appcompat:$androidx_appcompat" | ||
implementation "androidx.appcompat:appcompat:$androidx_appcompat" | ||
implementation "androidx.core:core-ktx:$androidx_core_ktx" | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | ||
} | ||
|
||
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle' | ||
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle' | ||
repositories { | ||
mavenCentral() | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" | ||
} |
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
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
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,22 +1,23 @@ | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
|
||
buildscript { | ||
ext.kotlin_version = '1.4.10' | ||
ext.kotlin_version = '1.4.32' | ||
repositories { | ||
jcenter() | ||
google() | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:4.1.1' | ||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6' | ||
classpath 'com.android.tools.build:gradle:4.1.3' | ||
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' | ||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
jcenter() | ||
google() | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
} |
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,110 @@ | ||
apply plugin: 'maven-publish' | ||
apply plugin: 'signing' | ||
|
||
task androidSourcesJar(type: Jar) { | ||
archiveClassifier.set('sources') | ||
if (project.plugins.findPlugin("com.android.library")) { | ||
// For Android libraries | ||
from android.sourceSets.main.java.srcDirs | ||
from android.sourceSets.main.kotlin.srcDirs | ||
} else { | ||
// For pure Kotlin libraries, in case you have them | ||
from sourceSets.main.java.srcDirs | ||
from sourceSets.main.kotlin.srcDirs | ||
} | ||
} | ||
artifacts { | ||
archives androidSourcesJar | ||
} | ||
|
||
group = PUBLISH_GROUP_ID | ||
version = PUBLISH_VERSION | ||
|
||
ext["signing.keyId"] = '' | ||
ext["signing.password"] = '' | ||
ext["signing.secretKeyRingFile"] = '' | ||
ext["ossrhUsername"] = '' | ||
ext["ossrhPassword"] = '' | ||
ext["sonatypeStagingProfileId"] = '' | ||
|
||
File secretPropsFile = project.rootProject.file('local.properties') | ||
if (secretPropsFile.exists()) { | ||
Properties p = new Properties() | ||
new FileInputStream(secretPropsFile).withCloseable { is -> | ||
p.load(is) | ||
} | ||
p.each { name, value -> | ||
ext[name] = value | ||
} | ||
} else { | ||
ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID') | ||
ext["signing.password"] = System.getenv('SIGNING_PASSWORD') | ||
ext["signing.secretKeyRingFile"] = System.getenv('SIGNING_SECRET_KEY_RING_FILE') | ||
ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME') | ||
ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD') | ||
ext["sonatypeStagingProfileId"] = System.getenv('SONATYPE_STAGING_PROFILE_ID') | ||
} | ||
|
||
publishing { | ||
publications { | ||
release(MavenPublication) { | ||
// The coordinates of the library, being set from variables that | ||
// we'll set up later | ||
groupId PUBLISH_GROUP_ID | ||
artifactId PUBLISH_ARTIFACT_ID | ||
version PUBLISH_VERSION | ||
|
||
// Two artifacts, the `aar` (or `jar`) and the sources | ||
if (project.plugins.findPlugin("com.android.library")) { | ||
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar") | ||
} else { | ||
artifact("$buildDir/libs/${project.getName()}-${version}.jar") | ||
} | ||
artifact androidSourcesJar | ||
|
||
// Mostly self-explanatory metadata | ||
pom { | ||
name = PUBLISH_ARTIFACT_ID | ||
description = 'It allows you to add a mask to EditText.' | ||
url = 'https://github.com/VicMikhailau/MaskedEditText' | ||
licenses { | ||
license { | ||
name = 'MaskedEditText License' | ||
url = 'https://github.com/VicMikhailau/MaskedEditText/blob/master/LICENSE' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = 'VicMikhailau' | ||
name = 'Victor Mikhailau' | ||
email = '[email protected]' | ||
} | ||
// Add all other devs here... | ||
} | ||
// Version control info - if you're using GitHub, follow the format as seen here | ||
scm { | ||
connection = 'scm:git:github.com:VicMikhailau/MaskedEditText.git' | ||
developerConnection = 'scm:git:ssh://github.com:VicMikhailau/MaskedEditText.git' | ||
url = 'https://github.com:VicMikhailau/MaskedEditText/tree/main' | ||
} | ||
} | ||
} | ||
} | ||
// The repository to publish to, Sonatype/MavenCentral | ||
repositories { | ||
maven { | ||
// This is an arbitrary name, you may also use "mavencentral" or | ||
// any other name that's descriptive for you | ||
name = "sonatype" | ||
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
credentials { | ||
username ossrhUsername | ||
password ossrhPassword | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
sign publishing.publications | ||
} |