Skip to content

Commit 605d8cf

Browse files
authored
Merge pull request #9 from Commit451/feature/open-source-library-migration
Migrate Easel with open-source-library-migration guide
2 parents 60a7ea6 + fa5cc93 commit 605d8cf

23 files changed

Lines changed: 520 additions & 344 deletions

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
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
26+
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/Easel'
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 & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
11
# Easel
22
Tint and color Android views with ease
33

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

66
# Gradle Dependency
7-
Add the jitpack url to the project:
8-
```groovy
9-
allprojects {
10-
repositories {
11-
...
12-
maven { url "https://jitpack.io" }
13-
}
14-
}
15-
```
16-
then, in your app `build.gradle`
17-
```groovy
7+
Add the library to your app `build.gradle`:
8+
```gradle
189
dependencies {
19-
implementation "com.github.Commit451:Easel:latest.version.here"
10+
implementation("com.commit451:easel:latest.version.here")
2011
}
2112
```
2213

app/build.gradle

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

app/build.gradle.kts

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

app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 4 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.easel.sample">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
43

54
<application
65
android:allowBackup="true"
@@ -9,6 +8,7 @@
98
android:theme="@style/AppTheme">
109
<activity
1110
android:name=".MainActivity"
11+
android:exported="true"
1212
android:label="@string/app_name"
1313
android:windowSoftInputMode="stateHidden">
1414
<intent-filter>
@@ -17,7 +17,7 @@
1717
<category android:name="android.intent.category.LAUNCHER" />
1818
</intent-filter>
1919
</activity>
20-
<activity android:name=".KotlinActivity"/>
20+
<activity android:name=".KotlinActivity" />
2121
</application>
2222

23-
</manifest>
23+
</manifest>

build.gradle

Lines changed: 0 additions & 29 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+
}

easel/build.gradle

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

easel/build.gradle.kts

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import com.vanniktech.maven.publish.AndroidSingleVariantLibrary
2+
import com.vanniktech.maven.publish.SonatypeHost
3+
4+
plugins {
5+
id("com.android.library")
6+
id("com.vanniktech.maven.publish")
7+
}
8+
9+
group = findProperty("GROUP") as String
10+
version = findProperty("VERSION_NAME") as String
11+
12+
android {
13+
namespace = "com.commit451.easel"
14+
compileSdk = 35
15+
16+
defaultConfig {
17+
minSdk = 14
18+
}
19+
20+
buildTypes {
21+
release {
22+
isMinifyEnabled = false
23+
proguardFiles(
24+
getDefaultProguardFile("proguard-android-optimize.txt"),
25+
"proguard-rules.pro"
26+
)
27+
}
28+
}
29+
30+
compileOptions {
31+
sourceCompatibility = JavaVersion.VERSION_17
32+
targetCompatibility = JavaVersion.VERSION_17
33+
}
34+
35+
lint {
36+
abortOnError = false
37+
}
38+
}
39+
40+
41+
dependencies {
42+
api("androidx.appcompat:appcompat:1.7.1")
43+
}
44+
45+
mavenPublishing {
46+
configure(
47+
AndroidSingleVariantLibrary(
48+
variant = "release",
49+
sourcesJar = true,
50+
publishJavadocJar = true,
51+
)
52+
)
53+
coordinates("com.commit451", "easel", version.toString())
54+
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
55+
if (System.getenv("RELEASE_SIGNING_ENABLED") == "true") {
56+
signAllPublications()
57+
}
58+
}

0 commit comments

Comments
 (0)