forked from kizitonwose/Time
-
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.
Merge pull request #1 from Meesho/jfrog-migration
Add publish script to Jfrog migration
- Loading branch information
Showing
10 changed files
with
76 additions
and
96 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,23 +1,88 @@ | ||
buildscript { | ||
ext.kotlin_version = '1.2.60' | ||
ext.kotlin_version = '1.5.10' | ||
|
||
repositories { | ||
google() | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:3.0.1' | ||
classpath 'com.android.tools.build:gradle:7.0.4' | ||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0' | ||
classpath 'com.palantir:jacoco-coverage:0.4.0' | ||
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.28.3" | ||
} | ||
} | ||
|
||
allprojects { | ||
apply plugin: "com.jfrog.artifactory" | ||
apply plugin: "maven-publish" | ||
apply plugin: 'java-library' | ||
repositories { | ||
google() | ||
jcenter() | ||
mavenCentral() | ||
} | ||
} | ||
|
||
ext.versionName = { -> | ||
def currentTag = 'git tag --points-at HEAD'.execute().in.text.toString().trim() | ||
def currentBranch = 'git rev-parse --abbrev-ref HEAD'.execute().in.text.toString().trim() | ||
def tagRegex = "[0-9.]*[0-9]" | ||
if (!currentTag.isEmpty() && currentTag.matches(tagRegex)) { | ||
// is not empty and is in following format 8.0 | ||
return currentTag | ||
} else { | ||
return currentBranch + '-SNAPSHOT' | ||
} | ||
} | ||
|
||
apply plugin: 'com.palantir.jacoco-full-report' | ||
def libraryGroupId = 'com.meesho.android' | ||
def libraryVersion = versionName() | ||
|
||
task androidSourcesJar(type: Jar) { | ||
archiveClassifier.set('sources') | ||
from sourceSets.main.java.srcDirs | ||
} | ||
|
||
project('time') { | ||
artifactoryPublish.dependsOn('build') | ||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
groupId = libraryGroupId | ||
artifactId = 'time' | ||
version = libraryVersion | ||
// Tell maven to prepare the generated "*.jar" file for publishing | ||
artifact("$buildDir/libs/time.jar") | ||
artifact androidSourcesJar | ||
|
||
pom.withXml { | ||
def dependencies = asNode().appendNode('dependencies') | ||
configurations.implementation.allDependencies.each { | ||
def dependency = dependencies.appendNode('dependency') | ||
dependency.appendNode('groupId', it.group) | ||
dependency.appendNode('artifactId', it.name) | ||
dependency.appendNode('version', it.version) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
artifactory { | ||
//The base Artifactory URL if not overridden by the publisher/resolver | ||
contextUrl = project.properties["JFROG_ARTIFACTORY_URL"] | ||
publish { | ||
repository { | ||
repoKey = libraryVersion.endsWith('-SNAPSHOT') ? project.properties["SNAPSHOT_REPO_NAME"] : | ||
project.properties["RELEASE_REPO_NAME"] | ||
username = project.properties["JFROG_ARTIFACTORY_USERNAME"] | ||
password = project.properties["JFROG_ARTIFACTORY_KEY"] | ||
} | ||
defaults { | ||
// Tell the Artifactory Plugin which artifacts should be published to Artifactory. | ||
publications('mavenJava') | ||
publishArtifacts = true | ||
// Publish generated POM files to Artifactory (true by default) | ||
publishPom = 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
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,3 +1,3 @@ | ||
include ':time', ':time-android' | ||
include ':time' | ||
rootProject.name = 'Time' | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
time-android/src/main/kotlin/com/kizitonwose/timeandroid/AndroidExtensions.kt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,20 +1,15 @@ | ||
apply plugin: 'kotlin' | ||
apply plugin: 'maven' | ||
apply plugin: 'jacoco' | ||
|
||
group = 'com.github.kizitonwose' | ||
|
||
dependencies { | ||
implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
// This is a false positive, documented at https://youtrack.jetbrains.com/issue/KT-23933 | ||
// noinspection DifferentStdlibGradleVersion | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" | ||
testImplementation 'junit:junit:4.12' | ||
} | ||
|
||
compileKotlin { | ||
kotlinOptions.jvmTarget = "1.6" | ||
kotlinOptions.jvmTarget = "1.8" | ||
} | ||
compileTestKotlin { | ||
kotlinOptions.jvmTarget = "1.6" | ||
kotlinOptions.jvmTarget = "1.8" | ||
} |