Skip to content

Commit

Permalink
Updated maven publish scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
woxblom committed Mar 21, 2023
1 parent 76f6c79 commit fe9cb04
Show file tree
Hide file tree
Showing 11 changed files with 168 additions and 168 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ YouTube demo video<br>
}

dependencies {
compile 'com.github.woxthebox:draglistview:1.7.2'
compile 'com.github.woxthebox:draglistview:1.7.3'
}

Add this to proguard rules, otherwise animations won't work correctly
Expand Down
17 changes: 11 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,25 @@

buildscript {
repositories {
jcenter()
mavenCentral()
google()
maven {
url = uri("https://plugins.gradle.org/m2/")
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:7.4.2'
}
}

plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
}
apply from: "${rootDir}/scripts/publish-root.gradle"

allprojects {
repositories {
jcenter()
mavenCentral()
google()
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
38 changes: 29 additions & 9 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
apply plugin: 'com.android.library'
plugins {
id 'com.android.library'
id 'maven-publish'
}

ext {
PUBLISH_GROUP_ID = 'com.github.woxthebox'
PUBLISH_VERSION = '1.7.3'
PUBLISH_ARTIFACT_ID = 'draglistview'
PUBLISH_DESCRIPTION = 'Drag and drop to re-order items in a list, grid or board.'
PUBLISH_URL = 'https://github.com/woxthebox/DragListView'
PUBLISH_LICENSE_NAME = 'The Apache Software License, Version 2.0'
PUBLISH_LICENSE_URL =
'https://github.com/elye/loaderviewlibrary/blob/master/LICENSE'
PUBLISH_DEVELOPER_ID = 'woxthebox'
PUBLISH_DEVELOPER_NAME = 'Magnus Woxblom'
PUBLISH_DEVELOPER_EMAIL = '[email protected]'
PUBLISH_SCM_CONNECTION =
'scm:[email protected]:woxthebox/DragListView.git'
PUBLISH_SCM_DEVELOPER_CONNECTION =
'scm:[email protected]:woxthebox/DragListView.git'
PUBLISH_SCM_URL =
'scm:[email protected]:woxthebox/DragListView.git'
}
apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"

android {
compileSdkVersion 29
buildToolsVersion '28.0.3'
compileSdkVersion 33

defaultConfig {
minSdkVersion 14
targetSdkVersion 29
versionCode 1
versionName "1.0"
targetSdkVersion 33
}
buildTypes {
release {
Expand All @@ -21,15 +42,14 @@ android {
includeAndroidResources = true
}
}
namespace 'com.woxthebox.draglistview'
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.3.0'
testImplementation 'org.robolectric:robolectric:3.3.2'
testImplementation 'org.mockito:mockito-core:2.7.22'
testImplementation 'junit:junit:4.12'
testImplementation 'com.squareup.assertj:assertj-android:1.0.0'
}

apply from: 'maven-publish.gradle'
27 changes: 0 additions & 27 deletions library/gradle.properties

This file was deleted.

112 changes: 0 additions & 112 deletions library/maven-publish.gradle

This file was deleted.

3 changes: 1 addition & 2 deletions library/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.woxthebox.draglistview" >
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
16 changes: 9 additions & 7 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
apply plugin: 'com.android.application'
plugins {
id 'com.android.application'
}

android {
compileSdkVersion 29
buildToolsVersion '28.0.3'
compileSdkVersion 33

defaultConfig {
applicationId "com.woxthebox.draglistview.sample"
minSdkVersion 14
targetSdkVersion 29
targetSdkVersion 33
versionCode 1
versionName "1.0"
}
Expand All @@ -17,13 +18,14 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
namespace 'com.woxthebox.draglistview.sample'
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':library')
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.3.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
}
5 changes: 2 additions & 3 deletions sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.woxthebox.draglistview.sample" >
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
Expand All @@ -23,7 +22,7 @@
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
78 changes: 78 additions & 0 deletions scripts/publish-module.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// Run ./gradlew publishReleasePublicationToSonatypeRepository in the terminal to upload
apply plugin: 'maven-publish'
apply plugin: 'signing'

task androidSourcesJar(type: Jar) {
archiveClassifier.set('sources')
if (project.plugins.findPlugin("com.android.library")) {
from android.sourceSets.main.java.srcDirs
} else {
from sourceSets.main.java.srcDirs
}
}

artifacts {
archives androidSourcesJar
}

group = PUBLISH_GROUP_ID
version = PUBLISH_VERSION

afterEvaluate {
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")) {
from components.release
} else {
artifact("$buildDir/libs/${project.getName()}-${version}.jar")
}

artifact androidSourcesJar

// Mostly self-explanatory metadata
pom {
name = PUBLISH_ARTIFACT_ID
description = PUBLISH_DESCRIPTION
url = PUBLISH_URL
licenses {
license {
name = PUBLISH_LICENSE_NAME
url = PUBLISH_LICENSE_URL
}
}
developers {
developer {
id = PUBLISH_DEVELOPER_ID
name = PUBLISH_DEVELOPER_NAME
email = PUBLISH_DEVELOPER_EMAIL
}
}

// Version control info - if you're using GitHub, follow the
// format as seen here
scm {
connection = PUBLISH_SCM_CONNECTION
developerConnection = PUBLISH_SCM_DEVELOPER_CONNECTION
url = PUBLISH_SCM_URL
}
}
}
}
}
}

ext["signing.keyId"] = rootProject.ext["signing.keyId"]
ext["signing.password"] = rootProject.ext["signing.password"]
ext["signing.secretKeyRingFile"] = rootProject.ext["signing.secretKeyRingFile"]

signing {
sign publishing.publications
}
Loading

0 comments on commit fe9cb04

Please sign in to comment.