Skip to content

Commit

Permalink
fix: address issues around deployment of release 1.9.0 (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
wax911 authored Mar 25, 2024
1 parent 2a69a11 commit 4b6187a
Show file tree
Hide file tree
Showing 24 changed files with 16,986 additions and 48 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/gradle-dokka.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
name: gradle-dokka-html
name: gradle-dokka

on:
push:
branches: [ develop ]

env:
CI: true

jobs:
generate-and-deploy-docs:
gradle-dokka:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: 17
distribution: 'adopt'

- name: Setup Gradle
uses: gradle/gradle-build-action@v3
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Generate docs with dokka
run: ./gradlew emojify:dokkaHtml
run: ./gradlew dokkaHtmlMultiModule

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
branch: docs # The branch the action should deploy to.
folder: emojify/build/docs/dokka # The folder the action should deploy.
folder: dokka-docs # The folder the action should deploy.
25 changes: 25 additions & 0 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 19 additions & 3 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/migrations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ plugins {
dependencies {
implementation(project(Libraries.AniTrend.Emojify.emojify))
implementation(project(Libraries.AniTrend.Emojify.contract))
implementation(project(Libraries.AniTrend.Emojify.initializer))
implementation(project(Libraries.AniTrend.Emojify.serializerKotlinx))

implementation(libs.google.android.material)
Expand Down
6 changes: 5 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@
android:exported="false"
tools:node="merge">
<meta-data
android:name="io.wax911.emojify.initializer.EmojiInitializer"
android:name="io.wax911.emojifysample.EmojiInitializer"
android:value="androidx.startup" />
<meta-data
android:name="io.wax911.emojify.initializer.AbstractEmojiInitializer"
android:value="androidx.startup"
tools:node="remove"/>
</provider>
</application>

Expand Down
3 changes: 0 additions & 3 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ plugins {
repositories {
google()
mavenCentral()
maven {
setUrl("https://www.jitpack.io")
}
maven {
setUrl("https://plugins.gradle.org/m2/")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ object Libraries {
object Emojify {
val emojify = Modules.Library.Emojify.path()
val contract = Modules.Library.Contract.path()
val initializer = Modules.Library.Initializer.path()
val serializerKotlinx = Modules.Library.SerializerKotlinX.path()
val serializerGson = Modules.Library.SerializerGson.path()
val serializerMoshi = Modules.Library.SerializerMoshi.path()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ internal object Modules {
enum class Library(override val id: String) : Module {
Emojify("emojify"),
Contract("contract"),
Initializer("initializer"),
SerializerKotlinX("serializer:kotlinx"),
SerializerGson("serializer:gson"),
SerializerMoshi("serializer:moshi"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,36 @@ import io.wax911.emoji.buildSrc.plugin.extensions.baseExtension
import io.wax911.emoji.buildSrc.plugin.extensions.isLibraryModule
import io.wax911.emoji.buildSrc.plugin.extensions.props
import io.wax911.emoji.buildSrc.plugin.extensions.publishingExtension
import io.wax911.emoji.buildSrc.module.Modules
import org.gradle.api.Project
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.tasks.bundling.Jar
import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.getValue
import org.gradle.kotlin.dsl.invoke
import org.gradle.kotlin.dsl.named
import org.jetbrains.dokka.Platform
import org.jetbrains.dokka.gradle.DokkaTask
import java.net.URL

private fun Project.dependenciesOfProject(): List<Modules.Module> {
return when (project.name) {
Modules.Library.Initializer.id -> listOf(
Modules.Library.Contract,
Modules.Library.Emojify,
)
Modules.Library.Emojify.id -> listOf(
Modules.Library.Contract,
)
Modules.Library.SerializerGson.id,
Modules.Library.SerializerMoshi.id,
Modules.Library.SerializerKotlinX.id -> listOf(
Modules.Library.Contract,
)
else -> emptyList()
}
}

private fun Project.createMavenPublicationUsing(sourcesJar: Jar) {
println("Applying publication configuration on ${project.path}")
publishingExtension().publications {
Expand All @@ -30,7 +50,7 @@ private fun Project.createMavenPublicationUsing(sourcesJar: Jar) {
from(component)

pom {
name.set("Android Emojify")
name.set("android-emojify")
description.set("This project is an android port of https://github.com/vdurmont/emoji-java which is a lightweight java library that helps you use Emojis in your java applications re-written in Kotlin.")
url.set("https://github.com/anitrend/android-emoji")
licenses {
Expand All @@ -55,7 +75,7 @@ private fun Project.createDokkaTaskProvider() = tasks.named<DokkaTask>("dokkaHtm
outputDirectory.set(buildDir.resolve("docs/dokka"))

// Set module name displayed in the final output
moduleName.set(project.name)
moduleName.set(this@createDokkaTaskProvider.name)

// Use default or set to custom path to cache directory
// to enable package-list caching
Expand Down Expand Up @@ -106,8 +126,26 @@ private fun Project.createDokkaTaskProvider() = tasks.named<DokkaTask>("dokkaHtm
// Repeat for multiple sourceRoots
sourceRoot(file("src"))

dependenciesOfProject().forEach { module ->
// Specifies the location of the project source code on the Web.
// If provided, Dokka generates "source" links for each declaration.
// Repeat for multiple mappings
sourceLink {
// Unix based directory relative path to the root of the project (where you execute gradle respectively).
localDirectory.set(file("src/main/kotlin"))

val repository = "https://github.com/anitrend/android-emojify/tree/develop"
// URL showing where the source code can be accessed through the web browser
remoteUrl.set(URL("$repository/${module.id.replace(":", "/")}/src/main/kotlin"))
// Suffix which is used to append the line number to the URL. Use #L for GitHub
remoteLineSuffix.set("#L")
}
}

// Used for linking to JDK documentation
jdkVersion.set(8)
jdkVersion.set(17)

platform.set(Platform.jvm)

// Disable linking to online kotlin-stdlib documentation
noStdlibLink.set(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ package io.wax911.emoji.buildSrc.plugin.components
import io.wax911.emoji.buildSrc.plugin.extensions.isLibraryModule
import org.gradle.api.Project

private fun Project.applyModulePlugin() {
internal fun Project.configurePlugins() {
if (isLibraryModule()) {
plugins.apply("com.android.library")
plugins.apply("org.jetbrains.dokka")
plugins.apply("com.diffplug.spotless")
plugins.apply("org.jetbrains.dokka")
plugins.apply("maven-publish")
} else
plugins.apply("com.android.application")
}

internal fun Project.configurePlugins() {
applyModulePlugin()
plugins.apply("kotlin-android")
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ fun Project.isSampleModule() =
name == Modules.App.Sample.id

fun Project.isLibraryModule() =
name == "emojify" ||
name == "contract" ||
name == "kotlinx" ||
name == "gson" ||
name == "moshi"
name != Modules.App.Sample.id

internal val Project.libs: LibrariesForLibs
get() = extensions.getByType<LibrariesForLibs>()
Expand Down
4 changes: 0 additions & 4 deletions contract/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@ plugins {
android {
namespace = "io.wax911.emojify.contract"
}

dependencies {
api(libs.androidx.startup.runtime)
}
Loading

0 comments on commit 4b6187a

Please sign in to comment.