Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
LDRAlighieri committed Jul 18, 2022
2 parents 350e7d6 + dec4c27 commit e405abf
Show file tree
Hide file tree
Showing 73 changed files with 938 additions and 986 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
# ChangeLog


## Version 1.5.5

* New: Build logic module.
* Update: Kotlin modules dependency to v1.7.10.
* Update: Kotlin coroutines modules dependency to v1.6.4.
* Update: Material components dependency to v1.6.1.
* Update: Minor update of other libraries.


## Version 1.5.4

* Update: `SlidingPaneLayout` `panelOpens` extensions. Changed listener setting method from `set` to `add`.
Expand Down
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[![Corbind](logo.svg)](https://ldralighieri.github.io/Corbind)

[![Maven Central](https://img.shields.io/maven-central/v/ru.ldralighieri.corbind/corbind.svg)](https://search.maven.org/search?q=g:ru.ldralighieri.corbind)
[![Kotlin Version](https://img.shields.io/badge/Kotlin-v1.6.21-blue.svg)](https://kotlinlang.org)
[![Kotlin Coroutines Version](https://img.shields.io/badge/Coroutines-v1.6.1-blue.svg)](https://kotlinlang.org/docs/reference/coroutines-overview.html)
[![Kotlin Version](https://img.shields.io/badge/Kotlin-v1.7.10-blue.svg)](https://kotlinlang.org)
[![Kotlin Coroutines Version](https://img.shields.io/badge/Coroutines-v1.6.4-blue.svg)](https://kotlinlang.org/docs/reference/coroutines-overview.html)
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0)

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/a1c9a1b1d1ce4ca7a201ab93492bf6e0)](https://app.codacy.com/gh/LDRAlighieri/Corbind)
Expand All @@ -25,28 +25,28 @@ This library is for Android applications only. Help you to transform Android UI

Platform bindings:
```groovy
implementation 'ru.ldralighieri.corbind:corbind:1.5.4'
implementation 'ru.ldralighieri.corbind:corbind:1.5.5'
```

AndroidX library bindings:
```groovy
implementation 'ru.ldralighieri.corbind:corbind-activity:1.5.4'
implementation 'ru.ldralighieri.corbind:corbind-appcompat:1.5.4'
implementation 'ru.ldralighieri.corbind:corbind-core:1.5.4'
implementation 'ru.ldralighieri.corbind:corbind-drawerlayout:1.5.4'
implementation 'ru.ldralighieri.corbind:corbind-leanback:1.5.4'
implementation 'ru.ldralighieri.corbind:corbind-lifecycle:1.5.4'
implementation 'ru.ldralighieri.corbind:corbind-navigation:1.5.4'
implementation 'ru.ldralighieri.corbind:corbind-recyclerview:1.5.4'
implementation 'ru.ldralighieri.corbind:corbind-slidingpanelayout:1.5.4'
implementation 'ru.ldralighieri.corbind:corbind-swiperefreshlayout:1.5.4'
implementation 'ru.ldralighieri.corbind:corbind-viewpager:1.5.4'
implementation 'ru.ldralighieri.corbind:corbind-viewpager2:1.5.4'
implementation 'ru.ldralighieri.corbind:corbind-activity:1.5.5'
implementation 'ru.ldralighieri.corbind:corbind-appcompat:1.5.5'
implementation 'ru.ldralighieri.corbind:corbind-core:1.5.5'
implementation 'ru.ldralighieri.corbind:corbind-drawerlayout:1.5.5'
implementation 'ru.ldralighieri.corbind:corbind-leanback:1.5.5'
implementation 'ru.ldralighieri.corbind:corbind-lifecycle:1.5.5'
implementation 'ru.ldralighieri.corbind:corbind-navigation:1.5.5'
implementation 'ru.ldralighieri.corbind:corbind-recyclerview:1.5.5'
implementation 'ru.ldralighieri.corbind:corbind-slidingpanelayout:1.5.5'
implementation 'ru.ldralighieri.corbind:corbind-swiperefreshlayout:1.5.5'
implementation 'ru.ldralighieri.corbind:corbind-viewpager:1.5.5'
implementation 'ru.ldralighieri.corbind:corbind-viewpager2:1.5.5'
```

Google 'material' library bindings:
```groovy
implementation 'ru.ldralighieri.corbind:corbind-material:1.5.4'
implementation 'ru.ldralighieri.corbind:corbind-material:1.5.5'
```

Snapshot build:
Expand All @@ -56,7 +56,7 @@ repositories {
}
dependencies {
implementation 'ru.ldralighieri.corbind:{module}:1.5.5-SNAPSHOT'
implementation 'ru.ldralighieri.corbind:{module}:1.5.6-SNAPSHOT'
}
```

Expand Down
52 changes: 52 additions & 0 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Copyright 2022 Vladimir Raupov
*
* 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.
*/

plugins {
`kotlin-dsl`
}

group = "ru.ldralighieri.corbind.buildlogic"

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

dependencies {
implementation(libs.android.gradlePlugin)
implementation(libs.kotlin.gradlePlugin)
implementation(libs.spotless.gradlePlugin)
implementation(libs.dokka.gradlePlugin)
}

gradlePlugin {
plugins {
register("dokka") {
id = "corbind.dokka"
implementationClass = "DokkaConventionPlugin"
}

register("library") {
id = "corbind.library"
implementationClass = "LibraryConventionPlugin"
}

register("spotless") {
id = "corbind.spotless"
implementationClass = "SpotlessConventionPlugin"
}
}
}
63 changes: 63 additions & 0 deletions build-logic/convention/src/main/kotlin/DokkaConventionPlugin.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* Copyright 2022 Vladimir Raupov
*
* 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.
*/

import org.gradle.api.JavaVersion
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.withType
import org.jetbrains.dokka.gradle.DokkaTask
import java.net.URL

@Suppress("unused")
class DokkaConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
pluginManager.apply("org.jetbrains.dokka")

tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets.named("main") {
jdkVersion.set(JavaVersion.VERSION_11.majorVersion.toInt())

skipDeprecated.set(false)
reportUndocumented.set(false)
skipEmptyPackages.set(true)

sourceLink {
val relPath = rootProject.projectDir.toPath().relativize(projectDir.toPath())
localDirectory.set(file("src/main/kotlin"))
remoteUrl.set(URL("https://github.com/LDRAlighieri/Corbind/tree/master/$relPath/src/main/kotlin"))
remoteLineSuffix.set("#L")
}

externalDocumentationLink {
url.set(URL("https://developer.android.com/reference/"))
packageListUrl.set(URL("https://developer.android.com/reference/package-list"))
}

externalDocumentationLink {
url.set(URL("https://developer.android.com/reference/"))
packageListUrl.set(URL("https://developer.android.com/reference/androidx/package-list"))
}

externalDocumentationLink {
url.set(URL("https://developer.android.com/reference/"))
packageListUrl.set(URL("https://developer.android.com/reference/com/google/android/material/package-list"))
}
}
}
}
}
}
47 changes: 47 additions & 0 deletions build-logic/convention/src/main/kotlin/LibraryConventionPlugin.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright 2022 Vladimir Raupov
*
* 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.
*/

import com.android.build.gradle.LibraryExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import ru.ldralighieri.corbind.configureKotlinAndroid

@Suppress("unused")
class LibraryConventionPlugin : Plugin<Project> {
@Suppress("UnstableApiUsage")
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply("com.android.library")
apply("kotlin-android")
apply("com.vanniktech.maven.publish")
}

extensions.configure<LibraryExtension> {
configureKotlinAndroid(this)
defaultConfig.targetSdk = findProperty("android.targetSdk").toString().toInt()

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
}
}
}
}
}
}
41 changes: 41 additions & 0 deletions build-logic/convention/src/main/kotlin/SpotlessConventionPlugin.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright 2022 Vladimir Raupov
*
* 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.
*/

import com.diffplug.gradle.spotless.SpotlessExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.getByType

@Suppress("unused")
class SpotlessConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
pluginManager.apply("com.diffplug.spotless")

val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
extensions.configure<SpotlessExtension> {
kotlin {
target("**/*.kt")
targetExclude("**/build/**/*.kt")
ktlint(libs.findVersion("ktlint").get().toString())
licenseHeaderFile(rootProject.file("spotless/copyright.kt"))
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright 2022 Vladimir Raupov
*
* 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.
*/

@file:Suppress("UnstableApiUsage")

package ru.ldralighieri.corbind

import com.android.build.api.dsl.CommonExtension
import org.gradle.api.JavaVersion
import org.gradle.api.Project
import org.gradle.api.plugins.ExtensionAware
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions

internal fun Project.configureKotlinAndroid(
commonExtension: CommonExtension<*, *, *, *>,
) {
commonExtension.apply {
compileSdk = findProperty("android.compileSdk").toString().toInt()

defaultConfig {
minSdk = findProperty("android.minSdk").toString().toInt()
}

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

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()

// Treat all Kotlin warnings as errors
allWarningsAsErrors = true

freeCompilerArgs = freeCompilerArgs + listOf(
"-opt-in=kotlinx.coroutines.ObsoleteCoroutinesApi",
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"
)
}
}
}

private fun CommonExtension<*, *, *, *>.kotlinOptions(block: KotlinJvmOptions.() -> Unit) {
(this as ExtensionAware).extensions.configure("kotlinOptions", block)
}
33 changes: 33 additions & 0 deletions build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright 2022 Vladimir Raupov
*
* 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.
*/

@file:Suppress("UnstableApiUsage")

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

dependencyResolutionManagement {
repositories {
google()
mavenCentral()
}
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}

include(":convention")
Loading

0 comments on commit e405abf

Please sign in to comment.