Skip to content

Commit aea2d96

Browse files
committed
Modernize build system for SDK 30 and publication Maven Central with manual bundle task
1 parent 0926823 commit aea2d96

File tree

15 files changed

+186
-80
lines changed

15 files changed

+186
-80
lines changed

README.md

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[![API](https://img.shields.io/badge/API-30%2B-green.svg?style=flat)](https://android-arsenal.com/api?level=30)
12
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
23
![Size](https://img.shields.io/badge/Size-Core:%20124%20KB%20|%20UI:%2068%20KB-e91e63.svg)
34

@@ -15,13 +16,14 @@ The arrival of Jetpack Compose and Compose Multiplatform has replaced the need f
1516

1617
### A final word
1718
No further feature requests or pull requests will be processed, as the library is considered a "finished" product.
18-
1919
As last contribution to the community the library has been published to Maven Central Repository.
2020

2121
Thank you to have adopted this library in your project.
2222

2323
# FlexibleAdapter
24-
- Last build: [v5.1.0](https://github.com/davideas/FlexibleAdapter/releases/tag/5.1.0) on 2018.09.30 with AndroidX
24+
- Last version [5.1.0](https://github.com/davideas/FlexibleAdapter/releases/tag/5.1.0)
25+
- Originally released with AndroidX on September 30, 2018.
26+
- Republished to Maven Central in March 2026.
2527

2628
### One Adapter many Apps
2729
> :mega: When initially Android:registered: team introduced the RecyclerView widget, we had to implement a custom Adapter in several applications, again and again to provide the items for our views.<br/>
@@ -33,6 +35,40 @@ The idea behind is to regroup multiple features in a unique library, without the
3335
The FlexibleAdapter helps developers to simplify this process without worrying too much about the Adapter anymore. It's easy to use, it has predefined logic for different situations and prevents common mistakes.<br/>
3436
This library is configurable and it guides the developers to create a better user experience and now, even more with the new features.
3537

38+
# Setup
39+
The original artifacts were hosted on JCenter. Since its shutdown, the old dependency will result in a `404 Not Found` error.
40+
As last contribution to the community the library has been published to Maven Central Repository.<br>
41+
I tried to keep the requirements as low as possible.
42+
43+
### Minimum Requirements
44+
To use this library in your project, ensure your environment meets at least the following requirements:
45+
46+
- **compileSdk** 30+ (Android 11)
47+
- **Gradle** 7.6+
48+
- **Android Gradle Plugin (AGP)** 7.4+
49+
- **JDK** 11+
50+
- **Kotlin** 1.7+
51+
52+
### build.gradle
53+
```
54+
repositories {
55+
mavenCentral()
56+
}
57+
```
58+
```
59+
dependencies {
60+
// Core library (required)
61+
implementation 'eu.davidea:flexible-adapter:5.1.0'
62+
63+
// UI extensions (recommended)
64+
implementation 'eu.davidea:flexible-adapter-ui:1.0.0'
65+
66+
// Optional extensions
67+
implementation 'eu.davidea:flexible-adapter-livedata:1.0.0'
68+
implementation 'eu.davidea:flexible-adapter-databinding:1.0.0'
69+
}
70+
```
71+
3672
### Features in main library
3773
* Simple, Single & Multi selection mode.
3874
* Mapping multi-view types with [Item interfaces](https://github.com/davideas/FlexibleAdapter/wiki/5.x-%7C-Item-Interfaces).
@@ -67,25 +103,6 @@ This library is configurable and it guides the developers to create a better use
67103
* [Live Data](https://github.com/davideas/FlexibleAdapter/wiki/Extensions-%7C-LiveData).
68104
* Data Binding.
69105

70-
# Setup
71-
The original artifacts were hosted on JCenter. Since its shutdown, the old dependency will result in a `404 Not Found` error.
72-
As last contribution to the community the library has been published to Maven Central Repository.
73-
74-
#### build.gradle
75-
```
76-
repositories {
77-
mavenCentral()
78-
}
79-
```
80-
```
81-
dependencies {
82-
implementation 'eu.davidea:flexible-adapter:5.1.0'
83-
implementation 'eu.davidea:flexible-adapter-ui:1.0.0'
84-
implementation 'eu.davidea:flexible-adapter-livedata:1.0.0'
85-
implementation 'eu.davidea:flexible-adapter-databinding:1.0.0'
86-
}
87-
```
88-
89106
# Wiki!
90107
I strongly recommend to read the **[Wiki](https://github.com/davideas/FlexibleAdapter/wiki) pages**, where you can find a comprehensive Tutorial.<br/>
91108

build.gradle

Lines changed: 60 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,28 @@ allprojects {
1515

1616
// Android SDK
1717
minSdk = 14
18+
compileSdk = 30
1819
targetSdk = 35
1920

2021
androidx = [
2122
recyclerView : "androidx.recyclerview:recyclerview:1.2.1",
2223
recyclerViewSelection : "androidx.recyclerview:recyclerview-selection:1.2.1",
23-
appCompat : "androidx.appcompat:appcompat:1.5.1",
24+
appCompat : "androidx.appcompat:appcompat:1.2.0",
2425
cardView : "androidx.cardview:cardview:1.0.0",
25-
annotation : "androidx.annotation:annotation:1.5.0",
26-
browser : "androidx.browser:browser:1.8.0",
26+
annotation : "androidx.annotation:annotation:1.1.0",
27+
browser : "androidx.browser:browser:1.3.0",
2728
vectorDrawable : "androidx.vectordrawable:vectordrawable:1.1.0",
2829
transition : "androidx.transition:transition:1.4.1",
29-
lifecycleExtensions: "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1",
30-
lifecycleLiveData : "androidx.lifecycle:lifecycle-livedata-ktx:2.5.1",
30+
lifecycleExtensions: "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0",
31+
lifecycleLiveData : "androidx.lifecycle:lifecycle-livedata-ktx:2.3.0",
3132
constraintLayout : "androidx.constraintlayout:constraintlayout:2.1.4",
32-
core : "androidx.core:core:1.9.0",
33+
core : "androidx.core:core:1.3.2",
3334
swipeRefreshLayout : "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
3435
]
3536

3637
// Google Material
3738
google = [
38-
material: "com.google.android.material:material:1.7.0"
39+
material: "com.google.android.material:material:1.3.0"
3940
]
4041

4142
// 3rd Libraries
@@ -65,6 +66,21 @@ allprojects {
6566
}
6667
}
6768

69+
allprojects {
70+
configurations.all {
71+
resolutionStrategy {
72+
// This prevents AGP 7.4.2 from bumping to 2.4.0, keeping compatibility to Android SDK 30
73+
// Having AGP 7.4.2 allows to target more recent plugins for versioning and publishing
74+
force "androidx.lifecycle:lifecycle-runtime:2.3.1"
75+
force "androidx.lifecycle:lifecycle-viewmodel:2.3.1"
76+
force "androidx.lifecycle:lifecycle-livedata:2.3.1"
77+
force "androidx.lifecycle:lifecycle-livedata-core:2.3.1"
78+
force "androidx.lifecycle:lifecycle-common:2.3.1"
79+
force "androidx.core:core:1.3.2"
80+
}
81+
}
82+
}
83+
6884
buildscript {
6985
repositories {
7086
google()
@@ -73,9 +89,43 @@ buildscript {
7389
}
7490

7591
dependencies {
76-
classpath "com.android.tools.build:gradle:9.1.0"
77-
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.36.0'
78-
classpath "de.mannodermaus.gradle.plugins:android-junit5:2.0.1"
92+
classpath "com.android.tools.build:gradle:7.4.2" // Allows max compatibility to SDK 30
93+
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.26.0' // Max version for AGP 7.4.2
7994
classpath "eu.davidea:grabver:2.0.3"
8095
}
8196
}
97+
98+
// Root task to create a single bundle for all libraries
99+
tasks.register("zipAllLibrariesBundle", Zip) {
100+
group = "publishing"
101+
description = "Zips all library artifacts into a single bundle with CHECKSUMS for the 2026 Portal."
102+
archiveFileName = "${publishedGroupId}-flexible-adapter-all-libraries-bundle.zip"
103+
destinationDirectory = layout.buildDirectory.dir("distributions")
104+
105+
doFirst {
106+
println "Executing zipAllLibrariesBundle..."
107+
}
108+
109+
println "\n--- Configuring Mega Bundle (with Checksums) ---"
110+
subprojects.findAll { it.plugins.hasPlugin('com.android.library') }.each { subproject ->
111+
// Ensure files are in the local bundle folder (which generates checksums) before zipping
112+
dependsOn "${subproject.path}:publish"
113+
114+
def subArtifact = subproject.ext.has('artifact') ? subproject.ext.artifact : subproject.name
115+
def subVersion = subproject.versioning.name
116+
117+
if (subVersion != "unspecified" && subVersion != null) {
118+
// Take from the subproject's build directory where checksums are generated
119+
def bundleFolder = subproject.layout.buildDirectory.dir("publishing/bundle")
120+
println "Adding to Zip: ${subproject.name} [${subArtifact}:${subVersion}]"
121+
from(bundleFolder)
122+
} else {
123+
println "WARNING: Skipping ${subproject.name} because version is unspecified"
124+
}
125+
}
126+
println "-----------------------------------------------"
127+
128+
doLast {
129+
println "Zipped bundle: ${archiveFileName.get()}"
130+
}
131+
}

flexible-adapter-app/build.gradle

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ versioning {
99
}
1010

1111
android {
12-
compileSdk targetSdk
12+
compileSdk = 30
1313
namespace 'eu.davidea.samples.flexibleadapter'
1414

1515
defaultConfig {
@@ -29,8 +29,8 @@ android {
2929
}
3030

3131
compileOptions {
32-
sourceCompatibility JavaVersion.VERSION_21
33-
targetCompatibility JavaVersion.VERSION_21
32+
sourceCompatibility JavaVersion.VERSION_1_8
33+
targetCompatibility JavaVersion.VERSION_1_8
3434
}
3535

3636
buildTypes {
@@ -39,7 +39,6 @@ android {
3939
minifyEnabled false
4040
}
4141
release {
42-
zipAlignEnabled true
4342
minifyEnabled true
4443
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
4544
}
@@ -96,7 +95,7 @@ dependencies {
9695
implementation 'eu.davidea:flipview:1.2.0'
9796

9897
// Test libraries
99-
testImplementation 'org.robolectric:robolectric:4.16.1'
98+
testImplementation 'org.robolectric:robolectric:4.5.1'
10099
testImplementation 'junit:junit:4.13.2'
101100
testImplementation 'org.hamcrest:hamcrest:3.0'
102101
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#Sun Mar 08 10:34:18 CET 2026
1+
#Fri Mar 13 19:19:26 CET 2026
22
MAJOR=5
33
MINOR=1
44
PATCH=0
55
PRE_RELEASE=
6-
BUILD=5599
6+
BUILD=5613
77
CODE=30

flexible-adapter-databinding/build.gradle

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,16 @@ ext {
1717
}
1818

1919
android {
20-
compileSdkVersion targetSdk
20+
compileSdk = rootProject.ext.compileSdk
2121
namespace 'eu.davidea.flexibleadapter.databinding'
2222

2323
defaultConfig {
2424
minSdk = rootProject.ext.minSdk
25-
targetSdk = rootProject.ext.targetSdk
26-
versionCode versioning.code
27-
versionName versioning.name
2825
}
2926

3027
compileOptions {
31-
targetCompatibility JavaVersion.VERSION_21
32-
sourceCompatibility JavaVersion.VERSION_21
28+
sourceCompatibility JavaVersion.VERSION_1_8
29+
targetCompatibility JavaVersion.VERSION_1_8
3330
}
3431

3532
buildTypes {
@@ -52,10 +49,11 @@ dependencies {
5249
compileOnly project(":flexible-adapter")
5350
compileOnly androidx.recyclerView
5451
// for NestedScrollingChild3
55-
implementation androidx.core
52+
implementation 'androidx.core:core:1.3.2'
5653
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
5754
}
5855

56+
// Apply publishing configuration when -Pall or module-specific property is set
5957
if (project.hasProperty('all') || project.hasProperty('databinding')) {
6058
apply from: '../publish.gradle'
61-
}
59+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#Sun Mar 08 10:34:18 CET 2026
1+
#Wed Mar 11 12:46:52 CET 2026
22
MAJOR=1
33
MINOR=0
44
PATCH=0
55
PRE_RELEASE=
6-
BUILD=193
6+
BUILD=199
77
CODE=3

flexible-adapter-livedata/build.gradle

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
plugins {
22
id 'com.android.library'
33
id 'eu.davidea.grabver'
4-
id 'de.mannodermaus.android-junit5'
54
}
65

76
versioning {
@@ -18,19 +17,16 @@ ext {
1817
}
1918

2019
android {
21-
compileSdk targetSdk
20+
compileSdk rootProject.ext.compileSdk
2221
namespace 'eu.davidea.flexibleadapter.livedata'
2322

2423
defaultConfig {
2524
minSdk = rootProject.ext.minSdk
26-
targetSdk = rootProject.ext.targetSdk
27-
versionCode versioning.code
28-
versionName versioning.name
2925
}
3026

3127
compileOptions {
32-
targetCompatibility JavaVersion.VERSION_21
33-
sourceCompatibility JavaVersion.VERSION_21
28+
sourceCompatibility JavaVersion.VERSION_1_8
29+
targetCompatibility JavaVersion.VERSION_1_8
3430
}
3531

3632
buildTypes {
@@ -65,6 +61,7 @@ dependencies {
6561
testImplementation project(":flexible-adapter")
6662
}
6763

64+
// Apply publishing configuration when -Pall or module-specific property is set
6865
if (project.hasProperty('all') || project.hasProperty('livedata')) {
6966
apply from: '../publish.gradle'
7067
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#Sun Mar 08 10:34:18 CET 2026
1+
#Wed Mar 11 12:48:28 CET 2026
22
MAJOR=1
33
MINOR=0
44
PATCH=0
55
PRE_RELEASE=
6-
BUILD=221
6+
BUILD=227
77
CODE=2

flexible-adapter-ui/build.gradle

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,16 @@ ext {
1717
}
1818

1919
android {
20-
compileSdk targetSdk
20+
compileSdk = rootProject.ext.compileSdk
2121
namespace 'eu.davidea.flexibleadapter.ui'
2222

2323
defaultConfig {
2424
minSdk = rootProject.ext.minSdk
25-
targetSdk = rootProject.ext.targetSdk
26-
versionCode versioning.code
27-
versionName versioning.name
2825
}
2926

3027
compileOptions {
31-
sourceCompatibility JavaVersion.VERSION_21
32-
targetCompatibility JavaVersion.VERSION_21
28+
sourceCompatibility JavaVersion.VERSION_1_8
29+
targetCompatibility JavaVersion.VERSION_1_8
3330
}
3431

3532
buildTypes {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#Sun Mar 08 10:34:18 CET 2026
1+
#Wed Mar 11 12:47:12 CET 2026
22
MAJOR=1
33
MINOR=0
44
PATCH=0
55
PRE_RELEASE=
6-
BUILD=58
6+
BUILD=60
77
CODE=6

0 commit comments

Comments
 (0)