Skip to content

Commit

Permalink
Merge pull request #576 from Orange-OpenSource/575-lib-xml-is-not-pub…
Browse files Browse the repository at this point in the history
…lished-on-maven-central

575 - lib-xml publication on Maven Central
  • Loading branch information
paulinea authored Jul 20, 2023
2 parents 8e0dca7 + 1b66992 commit 2f621eb
Show file tree
Hide file tree
Showing 16 changed files with 105 additions and 222 deletions.
44 changes: 20 additions & 24 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ plugins {
}

android {
namespace = "com.orange.ods.app"

compileSdk = Versions.compileSdk

defaultConfig {
Expand Down Expand Up @@ -112,38 +114,32 @@ dependencies {
implementation(project(":lib-xml"))
implementation(project(":theme-innovation-cup"))

implementation(Dependencies.composeMaterial3)
implementation(Dependencies.coreKtx)
implementation(Dependencies.kotlinReflect)
implementation(Dependencies.accompanistFlowLayout)
implementation(Dependencies.accompanistPager)
implementation(Dependencies.accompanistPagerIndicators)
implementation(Dependencies.accompanistSystemUiController)
implementation(Dependencies.activityCompose)
implementation(Dependencies.appCompat)
implementation(Dependencies.material)
implementation(Dependencies.browser)
implementation(Dependencies.coil)
implementation(Dependencies.coilCompose)
implementation(Dependencies.composeMaterial3)
implementation(Dependencies.composeUi)
implementation(Dependencies.lifecycleViewModelKtx)
implementation(Dependencies.composeUiTooling)
implementation(Dependencies.composeUiToolingPreview)
implementation(Dependencies.lifecycleRuntimeKtx)
implementation(Dependencies.activityCompose)
implementation(Dependencies.navigationCompose)
implementation(Dependencies.accompanistSystemUiController)
implementation(Dependencies.accompanistPager)
implementation(Dependencies.accompanistPagerIndicators)
implementation(Dependencies.accompanistFlowLayout)
implementation(Dependencies.coreKtx)
implementation(Dependencies.dataStorePreferences)
implementation(platform(Dependencies.firebaseBom))
implementation(Dependencies.firebaseCrashlytics)
implementation(Dependencies.webkit)
implementation(Dependencies.browser)
implementation(Dependencies.hiltAndroid)
kapt(Dependencies.hiltCompiler)
implementation(Dependencies.dataStorePreferences)
implementation(Dependencies.coil)
implementation(Dependencies.coilCompose)
implementation(Dependencies.kotlinReflect)
implementation(Dependencies.lifecycleRuntimeKtx)
implementation(Dependencies.lifecycleViewModelKtx)
implementation(Dependencies.material)
implementation(Dependencies.navigationCompose)
implementation(Dependencies.timber)

debugImplementation(Dependencies.composeUiTooling)
}

// Allow references to generated code
kapt {
correctErrorTypes = true
implementation(Dependencies.webkit)
}

tasks.register<Copy>("copyChangelog") {
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
~ * https://opensource.org/licenses/MIT.
~ */
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.orange.ods.app">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:name=".OdsApplication"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ package com.orange.ods.gradle
abstract class MavenCentralPublishPluginExtension {

companion object {
const val Name = "mavenCentralPublish"
const val NAME = "mavenCentralPublish"
const val RELEASE_COMPONENT_NAME = "release"
}

var artifactId: String? = null
Expand Down
53 changes: 53 additions & 0 deletions buildSrc/src/main/kotlin/library.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
*
* Copyright 2021 Orange
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* /
*/

import com.orange.ods.gradle.MavenCentralPublishPluginExtension
import com.orange.ods.gradle.Versions
import gradle.kotlin.dsl.accessors._ecf15b363eddec123ebdbce713433fa8.android

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("maven-central-publish")
}

android {
compileSdk = Versions.compileSdk

defaultConfig {
minSdk = Versions.minSdk
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFile("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), file("proguard-rules.pro"))
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = "11"
allWarningsAsErrors = true
}

publishing {
singleVariant(MavenCentralPublishPluginExtension.RELEASE_COMPONENT_NAME) {
withSourcesJar()
withJavadocJar()
}
}
}
16 changes: 5 additions & 11 deletions buildSrc/src/main/kotlin/maven-central-publish.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,22 @@ plugins {
}

val pluginExtension: MavenCentralPublishPluginExtension?
get() = extensions.findByName(MavenCentralPublishPluginExtension.Name) as? MavenCentralPublishPluginExtension?
get() = extensions.findByName(MavenCentralPublishPluginExtension.NAME) as? MavenCentralPublishPluginExtension?

apply {
if (pluginExtension == null) {
extensions.create<MavenCentralPublishPluginExtension>(MavenCentralPublishPluginExtension.Name)
extensions.create<MavenCentralPublishPluginExtension>(MavenCentralPublishPluginExtension.NAME)
}
}

afterEvaluate {
publishing {
publications {
create<MavenPublication>("release") {
from(components["release"])
create<MavenPublication>(MavenCentralPublishPluginExtension.RELEASE_COMPONENT_NAME) {
from(components[MavenCentralPublishPluginExtension.RELEASE_COMPONENT_NAME])
groupId = "com.orange.ods.android"
artifactId = pluginExtension?.artifactId ?: "ods-${project.name}"
this.version = version
artifact(tasks["sourcesJar"])

pom {
name.set(artifactId)
Expand Down Expand Up @@ -87,11 +86,6 @@ afterEvaluate {
"GNUPG_SIGNING_PASSWORD"
)
useInMemoryPgpKeys(signingKeyId, signingSecretKey, signingPassword)
sign(publishing.publications["release"])
sign(publishing.publications[MavenCentralPublishPluginExtension.RELEASE_COMPONENT_NAME])
}
}

tasks.register<Jar>("sourcesJar") {
archiveClassifier.set("sources")
from(android.sourceSets.getByName("main").java.srcDirs)
}
33 changes: 4 additions & 29 deletions lib-xml/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,13 @@ import com.orange.ods.gradle.Dependencies
import com.orange.ods.gradle.Versions

plugins {
id("com.android.library")
id("kotlin-android")
id("library")
id("kotlin-kapt")
}

android {
compileSdk = Versions.compileSdk

defaultConfig {
minSdk = Versions.minSdk
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFile("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), file("proguard-rules.pro"))
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = "11"
allWarningsAsErrors = true
freeCompilerArgs = freeCompilerArgs + "-opt-in=kotlin.RequiresOptIn"
}

namespace = "com.orange.ods.xml"

buildFeatures {
compose = true
viewBinding = true
Expand All @@ -59,9 +34,9 @@ dependencies {
implementation(project(":lib"))

implementation(Dependencies.accompanistDrawablePainter)
implementation(Dependencies.appCompat)
implementation(Dependencies.composeMaterial)
implementation(Dependencies.composeUi)
implementation(Dependencies.kotlinStdlibJdk8)

testImplementation(Dependencies.jUnit)
androidTestImplementation(Dependencies.testExtJUnit)
Expand Down
2 changes: 1 addition & 1 deletion lib-xml/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
~ */
-->

<manifest package="com.orange.ods.xml" />
<manifest />

44 changes: 7 additions & 37 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ import com.orange.ods.gradle.Versions

plugins {
id("com.google.devtools.ksp") version "1.7.10-1.0.6"
id("com.android.library")
id("kotlin-android")
id("library")
id("github")
id("maven-central-publish")
id("kotlin-parcelize")
}

Expand All @@ -28,33 +26,10 @@ plugins {
val previewThemeConfigurationClass = "com.orange.ods.theme.orange.OrangeThemeConfiguration"

android {
compileSdk = Versions.compileSdk
namespace = "com.orange.ods"

defaultConfig {
minSdk = Versions.minSdk

buildConfigField("com.orange.ods.theme.OdsThemeConfigurationContract", "PREVIEW_THEME_CONFIGURATION", "new $previewThemeConfigurationClass()")

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFile("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), file("proguard-rules.pro"))
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = "11"
allWarningsAsErrors = true
freeCompilerArgs = freeCompilerArgs + "-opt-in=kotlin.RequiresOptIn"
}

buildFeatures {
Expand All @@ -71,29 +46,24 @@ android {
}

dependencies {
compileOnly(project(":composable-processor"))
ksp(project(":composable-processor"))
api(project(":theme-contract"))
api(project(":theme-orange"))
api(Dependencies.composeMaterial)

implementation(Dependencies.composeMaterial3)

implementation(Dependencies.kotlinStdlibJdk8)
implementation(Dependencies.kotlinReflect)
compileOnly(project(":composable-processor"))

implementation(Dependencies.accompanistFlowLayout)
implementation(Dependencies.appCompat)
api(Dependencies.composeMaterial)
implementation(Dependencies.composeMaterial3)
implementation(Dependencies.composeUi)
implementation(Dependencies.composeUiTooling)
implementation(Dependencies.composeUiToolingPreview)
implementation(Dependencies.constraintLayoutCompose)
implementation(Dependencies.coreKtx)
implementation(Dependencies.customViewPoolingContainer) // This dependency is needed otherwise the compose preview does not work properly
implementation(Dependencies.kotlinReflect)
implementation(Dependencies.lifecycleRuntimeKtx)
implementation(Dependencies.constraintLayoutCompose)

testImplementation(Dependencies.jUnit)
androidTestImplementation(Dependencies.testExtJUnit)

ksp(project(":composable-processor"))
}
2 changes: 1 addition & 1 deletion lib/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
~ */
-->

<manifest package="com.orange.ods" />
<manifest />

2 changes: 1 addition & 1 deletion release/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ This file lists all the steps to follow when releasing a new version of ODS Andr

- Progress through the various submission steps.

- When step is `Store submissions`, select `Closed beta with Google Groups`, set `Email addresses` to `[email protected]` and click `Go to store submission`.
- When step is `Store submissions`, select `Closed beta with Google Groups`, set `Email addresses` to `[email protected]` and click `Go for store submission`.
![OMA Portal store submission](images/google_play_store_release_02.png)<br /><br />
Expand Down
33 changes: 3 additions & 30 deletions theme-contract/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,12 @@
import com.orange.ods.gradle.Versions

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("maven-central-publish")
id("library")
}

android {
compileSdk = Versions.compileSdk

defaultConfig {
minSdk = Versions.minSdk

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = "11"
allWarningsAsErrors = true
}

namespace = "com.orange.ods.theme"

buildFeatures {
compose = true
}
Expand All @@ -52,8 +27,6 @@ android {
}

dependencies {
implementation(com.orange.ods.gradle.Dependencies.coreKtx)
implementation(com.orange.ods.gradle.Dependencies.appCompat)
implementation(com.orange.ods.gradle.Dependencies.material)
implementation(com.orange.ods.gradle.Dependencies.composeMaterial)
implementation(com.orange.ods.gradle.Dependencies.kotlinReflect)
Expand Down
2 changes: 1 addition & 1 deletion theme-contract/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
~ */
-->

<manifest package="com.orange.ods.theme" />
<manifest />
Loading

0 comments on commit 2f621eb

Please sign in to comment.