Skip to content

Commit

Permalink
Merge pull request #4 from PatilSiddhesh/task/migrate_nexus_publish
Browse files Browse the repository at this point in the history
Migrate to nexus maven publish plugin
  • Loading branch information
PatilSiddhesh committed Jul 15, 2022
2 parents fd39045 + 09238c0 commit 44ce545
Show file tree
Hide file tree
Showing 15 changed files with 196 additions and 158 deletions.
3 changes: 0 additions & 3 deletions .idea/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/copyright/MIT_LICENCE.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

2 changes: 0 additions & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

119 changes: 0 additions & 119 deletions Holi/artifactory-nexus.gradle

This file was deleted.

18 changes: 12 additions & 6 deletions Holi/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@ plugins {
id 'com.android.library'
id 'kotlin-android'
}
apply from: 'artifactory-nexus.gradle'

ext {
PUBLISH_GROUP_ID = GROUPID
PUBLISH_VERSION = VERSION_NAME
PUBLISH_ARTIFACT_ID = POM_ARTIFACT_ID
}

apply from: "scripts/publish-module.gradle"

android {
compileSdkVersion 30
compileSdkVersion 32
buildToolsVersion "30.0.3"

defaultConfig {
minSdkVersion 21
targetSdkVersion 30
targetSdkVersion 32

consumerProguardFiles "consumer-rules.pro"
}
Expand All @@ -23,11 +29,11 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '11'
useIR = true
}
buildFeatures {
Expand Down
101 changes: 101 additions & 0 deletions Holi/scripts/publish-module.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/*
* MIT License
*
* Copyright (c) 2022 Siddhesh Patil, Siddroid.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/

apply plugin: 'maven-publish'
apply plugin: 'signing'

group = PUBLISH_GROUP_ID
version = PUBLISH_VERSION


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
}

afterEvaluate {
publishing {
publications {
release(MavenPublication) {
groupId GROUPID
artifactId POM_ARTIFACT_ID
version VERSION_NAME

if (project.plugins.findPlugin("com.android.library")) {
from components.release
} else {
from components.java
}

artifact androidSourcesJar

pom {
name = POM_ARTIFACT_ID
description = POM_DESCRIPTION
url = POM_URL
licenses {
license {
name = POM_LICENCE_NAME
url = POM_LICENCE_DIST
}
}
developers {
developer {
id = POM_DEVELOPER_ID
name = POM_DEVELOPER_NAME
email = POM_DEVELOPER_EMAIL
}
}
scm {
connection = POM_SCM_CONNECTION
developerConnection = POM_SCM_DEV_CONNECTION
url = POM_SCM_URL
}
}
}
}
}
}

signing {
useInMemoryPgpKeys(
rootProject.ext["signing.keyId"],
rootProject.ext["signing.key"],
rootProject.ext["signing.password"],
)
sign publishing.publications
}
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ plugins {
}

android {
compileSdkVersion 30
compileSdkVersion 32
buildToolsVersion "30.0.3"

defaultConfig {
applicationId "com.siddheshpatil.holi"
minSdkVersion 21
targetSdkVersion 30
targetSdkVersion 32
versionCode 1
versionName "1.0"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import com.siddroid.holi.data.samples.HoliSampleColorFactory
import com.siddroid.holi.ui.composables.HoliLazyBrushColumn

class GradientMixerMultiColorActivity : AppCompatActivity() {
@ExperimentalAnimationApi
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

Expand Down
30 changes: 18 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,32 +1,38 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.5.10'
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.0-alpha02'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10"
classpath 'com.android.tools.build:gradle:7.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}

task clean(type: Delete) {
delete rootProject.buildDir
}

ext {
projectComposeVersion = '1.0.0-beta09'
projectComposeActivityVersion = '1.3.0-beta02'
projectCoreKtxVersion = '1.5.0'
projectAppCompatVersion = '1.3.0'
projectMaterialVersion = "1.3.0"
projectConstraintLayoutVersion = "2.0.4"
projectComposeVersion = '1.1.1'
projectComposeActivityVersion = '1.5.0'
projectCoreKtxVersion = '1.8.0'
projectAppCompatVersion = '1.4.2'
projectMaterialVersion = "1.6.1"
projectConstraintLayoutVersion = "2.1.4"
projectJunitVersion = "4.13.2"
projectAndroidTestVersion = "1.1.2"
projectEspressoVersion = "3.3.0"
projectAndroidTestVersion = "1.1.3"
projectEspressoVersion = "3.4.0"

}

}
apply from: "${rootDir}/scripts/publish-root.gradle"
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ POM_LICENCE_DIST=https://github.com/patilsiddhesh/Holi/blob/main/LICENSE
POM_DEVELOPER_ID=patilsiddhesh
POM_DEVELOPER_NAME=Siddhesh Patil
POM_DEVELOPER_URL=https://github.com/patilsiddhesh/
POM_DEVELOPER_EMAIL=sid@siddroid.com
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Mar 27 22:20:48 IST 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Loading

0 comments on commit 44ce545

Please sign in to comment.