Skip to content

Commit fdb691e

Browse files
committed
Add: Creating library using jitpack
1 parent f9005f7 commit fdb691e

4 files changed

Lines changed: 39 additions & 16 deletions

File tree

app/build.gradle.kts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@ android {
1212
targetSdk = 35
1313
versionCode = 1
1414
versionName = "1.0"
15-
renderscriptTargetApi = 21 // Target RenderScript API version (21 or above)
15+
renderscriptTargetApi = 21
1616
renderscriptSupportModeEnabled =
17-
true // Enable support for RenderScript on devices that don't support it natively
18-
17+
true
1918
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2019
}
2120

2221
buildTypes {
23-
release {
22+
getByName("release") {
2423
isMinifyEnabled = false
2524
proguardFiles(
2625
getDefaultProguardFile("proguard-android-optimize.txt"),
@@ -44,10 +43,10 @@ dependencies {
4443
androidTestImplementation(libs.ext.junit)
4544
androidTestImplementation(libs.espresso.core)
4645

47-
//Glide
46+
// Glide dependencies
4847
implementation(libs.glide)
4948
annotationProcessor(libs.compiler)
5049

51-
implementation(project(":blurlibrary"))
50+
// Blur-Layout library
5251
implementation(project(":blurlibrary"))
5352
}

blurlibrary/build.gradle.kts

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,51 @@ plugins {
44
}
55

66
android {
7-
namespace = "net.app.nfusion.blurlibrary"
7+
namespace = "net.app.nfusion.blurlayoutlibrary"
88
compileSdk = 35
99

1010
defaultConfig {
1111
minSdk = 21
12-
1312
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
1413
consumerProguardFiles("consumer-rules.pro")
1514
}
1615

1716
buildTypes {
18-
release {
17+
getByName("release") {
1918
isMinifyEnabled = false
2019
proguardFiles(
2120
getDefaultProguardFile("proguard-android-optimize.txt"),
2221
"proguard-rules.pro"
2322
)
2423
}
2524
}
25+
2626
compileOptions {
2727
sourceCompatibility = JavaVersion.VERSION_17
2828
targetCompatibility = JavaVersion.VERSION_17
2929
}
30-
}
3130

31+
publishing {
32+
singleVariant("release") {
33+
withSourcesJar()
34+
withJavadocJar()
35+
}
36+
}
37+
}
3238
dependencies {
33-
implementation(libs.appcompat)
34-
implementation(libs.material)
35-
testImplementation(libs.junit)
36-
androidTestImplementation(libs.ext.junit)
37-
androidTestImplementation(libs.espresso.core)
38-
}
39+
implementation(libs.annotations)
40+
implementation(libs.annotation.jvm)
41+
}
42+
43+
afterEvaluate {
44+
publishing {
45+
publications {
46+
create<MavenPublication>("release") {
47+
from(components["release"])
48+
groupId = "com.github.zayedcom"
49+
artifactId = "blurlayoutlibrary"
50+
version = "1.0"
51+
}
52+
}
53+
}
54+
}

gradle/libs.versions.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ appcompat = "1.7.0"
99
material = "1.12.0"
1010
activity = "1.10.0"
1111
constraintlayout = "2.2.0"
12+
annotations = "23.0.0"
13+
annotationJvm = "1.9.1"
1214

1315
[libraries]
1416
compiler = { module = "com.github.bumptech.glide:compiler", version.ref = "compiler" }
@@ -20,6 +22,8 @@ appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "a
2022
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
2123
activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
2224
constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
25+
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }
26+
annotation-jvm = { group = "androidx.annotation", name = "annotation-jvm", version.ref = "annotationJvm" }
2327

2428
[plugins]
2529
android-application = { id = "com.android.application", version.ref = "agp" }

jitpack.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
jdk:
2+
- openjdk17
3+
before_install:
4+
- ./scripts/prepareJitpackEnvironment.sh

0 commit comments

Comments
 (0)