Skip to content

Commit 6a85a09

Browse files
authored
Preparation for 3.0.0 release (#578)
- Change the groupId in preparation to google maven - Update the README accordingly - Update the dependent library versions - Remove the obsolete plugins for publishing to maven - Introduced maven pubilsher plugin (https://developer.android.com/studio/build/maven-publish-plugin) instead
1 parent d7a6680 commit 6a85a09

File tree

9 files changed

+88
-130
lines changed

9 files changed

+88
-130
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,20 @@ Add the following dependency to your `build.gradle` file:
1010

1111
```
1212
dependencies {
13-
implementation 'com.google.android:flexbox:2.0.1'
13+
implementation 'com.google.android.flexbox:flexbox:3.0.0'
1414
}
1515
```
1616

17-
**Note that the default values for `alignItems` and `alignContent` for `FlexboxLayout` have been changed from `stretch` to `flex_start` starting from 2.0.0, it may break the existing apps.
18-
Please make sure to set `stretch` explicitly if you want to apply the behavior of `stretch`.**
17+
**Starting from 3.0.0, the groupId is changed to `com.google.android.flexbox` in preparation to uploading the artifacts to google maven.
18+
You can still download the artifacts from jcenter for the past versions with the prior groupId (`com.google.android`), but migrating the library 3.0.0 is recommended.**
1919

20+
Note that the default values for `alignItems` and `alignContent` for `FlexboxLayout` have been changed from `stretch` to `flex_start` starting from 2.0.0, it may break the existing apps.
21+
Please make sure to set `stretch` explicitly if you want to apply the behavior of `stretch`.
2022

21-
**Note that starting from 1.1.0, the library is expected to use with AndroidX. Please migrate to [AndroidX](https://developer.android.com/jetpack/androidx/migrate) if you use 1.1.0 or above.**
2223

23-
**Please use 1.0.0 if you haven't migrated to AndroidX.**
24+
Note that starting from 1.1.0, the library is expeced to use with AndroidX. Please migrate to [AndroidX](https://developer.android.com/jetpack/androidx/migrate) if you use 1.1.0 or above.
25+
26+
Please use 1.0.0 if you haven't migrated to AndroidX.
2427

2528

2629
# Usage

build.gradle

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,21 @@
1919
buildscript {
2020
ext {
2121
minSdkVersion = 14
22-
targetSdkVersion = 29
23-
compileSdkVersion = 29
22+
targetSdkVersion = 30
23+
compileSdkVersion = 30
2424

25-
androidGradlePluginVersion = "3.5.2"
26-
androidMavenGradlePluginVersion = "1.5"
27-
androidxAnnotationVersion = "1.1.0"
28-
androidxAppCompatVersion = "1.1.0"
29-
androidxCoreVersion = "1.1.0"
30-
androidxPreferenceVersion = "1.1.0"
31-
androidxRecyclerViewVersion = "1.1.0"
32-
androidxEspressoVersion = "3.2.0"
33-
androidxTestExtVersion = "1.1.1"
34-
androidxTestVersion = "1.2.0"
35-
junitVersion = "4.12"
36-
gradleBintrayPluginVersion = "1.6"
37-
kotlinVersion = "1.3.61"
38-
materialVersion = "1.0.0"
25+
androidGradlePluginVersion = "4.2.0"
26+
androidxAnnotationVersion = "1.2.0"
27+
androidxAppCompatVersion = "1.2.0"
28+
androidxCoreVersion = "1.3.2"
29+
androidxPreferenceVersion = "1.1.1"
30+
androidxRecyclerViewVersion = "1.2.0"
31+
androidxEspressoVersion = "3.3.0"
32+
androidxTestExtVersion = "1.1.2"
33+
androidxTestVersion = "1.3.0"
34+
junitVersion = "4.13.2"
35+
kotlinVersion = "1.4.32"
36+
materialVersion = "1.3.0"
3937
}
4038

4139
repositories {
@@ -44,8 +42,6 @@ buildscript {
4442
}
4543
dependencies {
4644
classpath "com.android.tools.build:gradle:$androidGradlePluginVersion"
47-
classpath "com.github.dcendents:android-maven-gradle-plugin:$androidMavenGradlePluginVersion"
48-
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$gradleBintrayPluginVersion"
4945
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
5046
// NOTE: Do not place your application dependencies here; they belong
5147
// in the individual module build.gradle files

demo-playground/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ android {
4040

4141
dependencies {
4242
implementation project(":flexbox")
43+
implementation "androidx.annotation:annotation:${rootProject.androidxAnnotationVersion}"
4344
implementation "androidx.appcompat:appcompat:${rootProject.androidxAppCompatVersion}"
4445
implementation "androidx.preference:preference:${rootProject.androidxPreferenceVersion}"
4546
implementation "com.google.android.material:material:${rootProject.materialVersion}"

flexbox/bintray.gradle

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

flexbox/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717
apply plugin: 'com.android.library'
1818
apply plugin: 'kotlin-android'
19-
apply from: 'maven.gradle'
20-
apply from: 'bintray.gradle'
19+
apply from: 'maven-puglisher-plugin.gradle'
2120

2221
android {
2322
compileSdkVersion rootProject.ext.compileSdkVersion

flexbox/constants.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ ext {
2020

2121
githubUrl = 'https://github.com/google/flexbox-layout'
2222

23-
mavenGroup = 'com.google.android'
23+
mavenGroup = 'com.google.android.flexbox'
2424
mavenArtifactId = 'flexbox'
25-
mavenVersion = '2.0.1'
25+
mavenVersion = '3.0.0'
2626

2727
bintrayOrg = 'google'
2828
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Copyright 2021 Google Inc. All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
apply plugin: 'maven-publish'
18+
apply from: 'constants.gradle'
19+
20+
afterEvaluate {
21+
22+
publishing {
23+
publications {
24+
release(MavenPublication) {
25+
from components.release
26+
27+
groupId = "$mavenGroup"
28+
artifactId = "$mavenArtifactId"
29+
version = "$mavenVersion"
30+
31+
artifact androidSourcesJar
32+
33+
pom {
34+
name = "$projectName"
35+
description = "$projectDesc"
36+
licenses {
37+
license {
38+
name = 'The Apache Software License, Version 2.0'
39+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
40+
distribution = 'repo'
41+
}
42+
}
43+
developers {
44+
developer {
45+
name = 'Google'
46+
}
47+
}
48+
scm {
49+
connection = "${githubUrl}.git"
50+
url = githubUrl
51+
}
52+
}
53+
}
54+
}
55+
}
56+
}
57+
58+
task androidSourcesJar(type: Jar) {
59+
archiveClassifier.set('sources')
60+
from android.sourceSets.main.java.srcDirs
61+
}

flexbox/maven.gradle

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

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip

0 commit comments

Comments
 (0)