Skip to content

Commit 6ee3c79

Browse files
committed
build: migrate to modern Kotlin DSL and Maven Central release flow
1 parent 72db4a0 commit 6ee3c79

16 files changed

Lines changed: 204 additions & 129 deletions

File tree

.github/workflows/ci.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
11
name: Build
2-
on: [pull_request, push]
2+
3+
on:
4+
push:
5+
pull_request:
6+
37
jobs:
48
build:
59
runs-on: ubuntu-latest
10+
611
steps:
7-
- name: Checkout the code
8-
uses: actions/checkout@v2
9-
- name: Build the app
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Configure JDK
16+
uses: actions/setup-java@v4
17+
with:
18+
distribution: zulu
19+
java-version: '17'
20+
cache: gradle
21+
22+
- name: Validate Gradle Wrapper
23+
uses: gradle/actions/wrapper-validation@v4
24+
25+
- name: Build
1026
run: ./gradlew build
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
env:
9+
RELEASE_SIGNING_ENABLED: true
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
if: github.repository == 'Commit451/QuickActionView'
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Install JDK
21+
uses: actions/setup-java@v4
22+
with:
23+
distribution: zulu
24+
java-version: '17'
25+
cache: gradle
26+
27+
- name: Release to Maven Central
28+
run: ./gradlew publishAndReleaseToMavenCentral -PVERSION_NAME="${GITHUB_REF_NAME}" --no-configuration-cache
29+
env:
30+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
31+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
32+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }}
33+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}

README.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,17 @@
11
# QuickActionView
22
View that shows quick actions when long pressed, inspired by Pinterest
33

4-
[![Build Status](https://travis-ci.org/Commit451/QuickActionView.svg?branch=master)](https://travis-ci.org/Commit451/QuickActionView) [![](https://jitpack.io/v/Commit451/QuickActionView.svg)](https://jitpack.io/#Commit451/QuickActionView)
4+
[![Build](https://github.com/Commit451/QuickActionView/actions/workflows/ci.yml/badge.svg)](https://github.com/Commit451/QuickActionView/actions/workflows/ci.yml) [![Maven Central](https://img.shields.io/maven-central/v/com.commit451/quickactionview.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/com.commit451/quickactionview)
55

6-
![Sample Gif](https://raw.githubusercontent.com/Commit451/QuickActionView/master/screenshots/qav.gif)
6+
![Sample Gif](https://raw.githubusercontent.com/Commit451/QuickActionView/main/screenshots/qav.gif)
77

88
# Gradle Dependency
99

10-
Add this in your root `build.gradle` file (**not** your module `build.gradle` file):
10+
Add the library to your project `build.gradle`:
1111

12-
```gradle
13-
allprojects {
14-
repositories {
15-
...
16-
maven { url "https://jitpack.io" }
17-
}
18-
}
19-
```
20-
21-
Then, add the library to your project `build.gradle`
2212
```gradle
2313
dependencies {
24-
compile 'com.github.Commit451:QuickActionView:latest.release.here'
14+
implementation("com.commit451:quickactionview:latest.release.here")
2515
}
2616
```
2717

app/build.gradle

Lines changed: 0 additions & 32 deletions
This file was deleted.

app/build.gradle.kts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
plugins {
2+
id("com.android.application")
3+
}
4+
5+
android {
6+
namespace = "com.commit451.quickactionview.sample"
7+
compileSdk = 35
8+
9+
defaultConfig {
10+
applicationId = "com.commit451.quickactionview.sample"
11+
minSdk = 21
12+
targetSdk = 35
13+
versionCode = 1
14+
versionName = "1.0"
15+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
16+
}
17+
18+
buildTypes {
19+
release {
20+
isMinifyEnabled = false
21+
proguardFiles(
22+
getDefaultProguardFile("proguard-android-optimize.txt"),
23+
"proguard-rules.pro"
24+
)
25+
}
26+
}
27+
28+
compileOptions {
29+
sourceCompatibility = JavaVersion.VERSION_17
30+
targetCompatibility = JavaVersion.VERSION_17
31+
}
32+
}
33+
34+
dependencies {
35+
implementation("androidx.appcompat:appcompat:1.7.1")
36+
implementation("com.google.android.material:material:1.13.0")
37+
implementation("androidx.recyclerview:recyclerview:1.4.0")
38+
39+
implementation(project(":quickactionview"))
40+
}

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.commit451.quickactionview.sample">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
43

54
<application
65
android:allowBackup="true"
@@ -21,9 +20,7 @@
2120

2221
</activity>
2322

24-
<activity android:name=".RecyclerViewActivity">
25-
26-
</activity>
23+
<activity android:name=".RecyclerViewActivity" />
2724

2825
</application>
2926

build.gradle

Lines changed: 0 additions & 23 deletions
This file was deleted.

build.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
plugins {
2+
id("com.android.application") version "9.1.0" apply false
3+
id("com.android.library") version "9.1.0" apply false
4+
id("com.vanniktech.maven.publish") version "0.30.0" apply false
5+
}
6+
7+
tasks.register<Delete>("clean") {
8+
delete(rootProject.layout.buildDirectory)
9+
}

gradle.properties

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1-
# Project-wide Gradle settings.
1+
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
2+
android.useAndroidX=true
23

3-
# IDE (e.g. Android Studio) users:
4-
# Gradle settings configured through the IDE *will override*
5-
# any settings specified in this file.
4+
GROUP=com.commit451
5+
POM_ARTIFACT_ID=quickactionview
6+
VERSION_NAME=2.0.1
67

7-
# For more details on how to configure your build environment visit
8-
# http://www.gradle.org/docs/current/userguide/build_environment.html
8+
POM_NAME=QuickActionView
9+
POM_DESCRIPTION=View that shows quick actions when long pressed, inspired by Pinterest
10+
POM_INCEPTION_YEAR=2020
11+
POM_URL=https://github.com/Commit451/QuickActionView/
912

10-
# Specifies the JVM arguments used for the daemon process.
11-
# The setting is particularly useful for tweaking memory settings.
12-
# Default value: -Xmx10248m -XX:MaxPermSize=256m
13-
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
13+
POM_LICENSE_NAME=The Apache Software License, Version 2.0
14+
POM_LICENSE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt
15+
POM_LICENSE_DIST=repo
1416

15-
# When configured, Gradle will run in incubating parallel mode.
16-
# This option should only be used with decoupled projects. More details, visit
17-
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18-
# org.gradle.parallel=true
19-
android.enableJetifier=true
20-
android.useAndroidX=true
17+
POM_SCM_URL=https://github.com/Commit451/QuickActionView/
18+
POM_SCM_CONNECTION=scm:git:git://github.com/Commit451/QuickActionView.git
19+
POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/Commit451/QuickActionView.git
20+
21+
POM_DEVELOPER_ID=Commit451
22+
POM_DEVELOPER_NAME=Commit 451
23+
POM_DEVELOPER_URL=https://github.com/Commit451/
24+
25+
SONATYPE_CONNECT_TIMEOUT_SECONDS=60
26+
SONATYPE_CLOSE_TIMEOUT_SECONDS=900
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)