Skip to content

Commit

Permalink
Preparation for 3.0.0 release (#578)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
thagikura committed May 20, 2021
1 parent d7a6680 commit 6a85a09
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 130 deletions.
13 changes: 8 additions & 5 deletions README.md
Expand Up @@ -10,17 +10,20 @@ Add the following dependency to your `build.gradle` file:

```
dependencies {
implementation 'com.google.android:flexbox:2.0.1'
implementation 'com.google.android.flexbox:flexbox:3.0.0'
}
```

**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.
Please make sure to set `stretch` explicitly if you want to apply the behavior of `stretch`.**
**Starting from 3.0.0, the groupId is changed to `com.google.android.flexbox` in preparation to uploading the artifacts to google maven.
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.**

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.
Please make sure to set `stretch` explicitly if you want to apply the behavior of `stretch`.

**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.**

**Please use 1.0.0 if you haven't migrated to AndroidX.**
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.

Please use 1.0.0 if you haven't migrated to AndroidX.


# Usage
Expand Down
32 changes: 14 additions & 18 deletions build.gradle
Expand Up @@ -19,23 +19,21 @@
buildscript {
ext {
minSdkVersion = 14
targetSdkVersion = 29
compileSdkVersion = 29
targetSdkVersion = 30
compileSdkVersion = 30

androidGradlePluginVersion = "3.5.2"
androidMavenGradlePluginVersion = "1.5"
androidxAnnotationVersion = "1.1.0"
androidxAppCompatVersion = "1.1.0"
androidxCoreVersion = "1.1.0"
androidxPreferenceVersion = "1.1.0"
androidxRecyclerViewVersion = "1.1.0"
androidxEspressoVersion = "3.2.0"
androidxTestExtVersion = "1.1.1"
androidxTestVersion = "1.2.0"
junitVersion = "4.12"
gradleBintrayPluginVersion = "1.6"
kotlinVersion = "1.3.61"
materialVersion = "1.0.0"
androidGradlePluginVersion = "4.2.0"
androidxAnnotationVersion = "1.2.0"
androidxAppCompatVersion = "1.2.0"
androidxCoreVersion = "1.3.2"
androidxPreferenceVersion = "1.1.1"
androidxRecyclerViewVersion = "1.2.0"
androidxEspressoVersion = "3.3.0"
androidxTestExtVersion = "1.1.2"
androidxTestVersion = "1.3.0"
junitVersion = "4.13.2"
kotlinVersion = "1.4.32"
materialVersion = "1.3.0"
}

repositories {
Expand All @@ -44,8 +42,6 @@ buildscript {
}
dependencies {
classpath "com.android.tools.build:gradle:$androidGradlePluginVersion"
classpath "com.github.dcendents:android-maven-gradle-plugin:$androidMavenGradlePluginVersion"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$gradleBintrayPluginVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
1 change: 1 addition & 0 deletions demo-playground/build.gradle
Expand Up @@ -40,6 +40,7 @@ android {

dependencies {
implementation project(":flexbox")
implementation "androidx.annotation:annotation:${rootProject.androidxAnnotationVersion}"
implementation "androidx.appcompat:appcompat:${rootProject.androidxAppCompatVersion}"
implementation "androidx.preference:preference:${rootProject.androidxPreferenceVersion}"
implementation "com.google.android.material:material:${rootProject.materialVersion}"
Expand Down
41 changes: 0 additions & 41 deletions flexbox/bintray.gradle

This file was deleted.

3 changes: 1 addition & 2 deletions flexbox/build.gradle
Expand Up @@ -16,8 +16,7 @@

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: 'maven.gradle'
apply from: 'bintray.gradle'
apply from: 'maven-puglisher-plugin.gradle'

android {
compileSdkVersion rootProject.ext.compileSdkVersion
Expand Down
4 changes: 2 additions & 2 deletions flexbox/constants.gradle
Expand Up @@ -20,9 +20,9 @@ ext {

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

mavenGroup = 'com.google.android'
mavenGroup = 'com.google.android.flexbox'
mavenArtifactId = 'flexbox'
mavenVersion = '2.0.1'
mavenVersion = '3.0.0'

bintrayOrg = 'google'
}
61 changes: 61 additions & 0 deletions flexbox/maven-puglisher-plugin.gradle
@@ -0,0 +1,61 @@
/*
* Copyright 2021 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

apply plugin: 'maven-publish'
apply from: 'constants.gradle'

afterEvaluate {

publishing {
publications {
release(MavenPublication) {
from components.release

groupId = "$mavenGroup"
artifactId = "$mavenArtifactId"
version = "$mavenVersion"

artifact androidSourcesJar

pom {
name = "$projectName"
description = "$projectDesc"
licenses {
license {
name = 'The Apache Software License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
}
developers {
developer {
name = 'Google'
}
}
scm {
connection = "${githubUrl}.git"
url = githubUrl
}
}
}
}
}
}

task androidSourcesJar(type: Jar) {
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
}
61 changes: 0 additions & 61 deletions flexbox/maven.gradle

This file was deleted.

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip

0 comments on commit 6a85a09

Please sign in to comment.