Skip to content

Commit

Permalink
fix rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
RadekKuzel committed Jun 19, 2024
1 parent 2493556 commit 301c171
Show file tree
Hide file tree
Showing 27 changed files with 127 additions and 118 deletions.
96 changes: 52 additions & 44 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,58 +9,70 @@ plugins {
alias(libs.plugins.gradle.maven.publish) apply true
alias(libs.plugins.detekt) apply true
alias(libs.plugins.dokka) apply false
signing
}

subprojects {
apply<DokkaPlugin>()
apply<MavenPublishPlugin>()

group = "io.github.cleverlance.linguine"
version = System.getenv("NEXT_VERSION") ?: "0.2.0"
group = "com.qinshift.linguine"
version = System.getenv("NEXT_VERSION") ?: "0.3.0"

mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, automaticRelease = true)
signAllPublications()
val isLocalPublish = project.gradle.startParameter.taskNames.any { it.contains("publishToMavenLocal") }

pom {
name = "Linguine"
description = "Simplifies the localization process in Kotlin projects."
inceptionYear = "2024"
url = "https://github.com/cleverlance/linguine/"
licenses {
license {
name = "The MIT License"
url = "https://github.com/cleverlance/linguine/blob/main/license.md"
distribution = "https://github.com/cleverlance/linguine/blob/main/license.md"
}
}
developers {
developer {
id = "RealDanie1"
name = "Daniel Pecuch"
url = "https://github.com/RealDanie1"
}
developer {
id = "RadekKuzel"
name = "Radek Kůžel"
url = "https://github.com/RadekKuzel"
if (!isLocalPublish) {
apply<SigningPlugin>()


extensions.configure<com.vanniktech.maven.publish.MavenPublishBaseExtension>("mavenPublishing") {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, automaticRelease = true)
signAllPublications()

pom {
name.set("Linguine")
description.set("Simplifies the localization process in Kotlin projects.")
inceptionYear.set("2024")
url.set("https://github.com/cleverlance/linguine/")
licenses {
license {
name.set("The MIT License")
url.set("https://github.com/cleverlance/linguine/blob/main/license.md")
distribution.set("https://github.com/cleverlance/linguine/blob/main/license.md")
}
}
developer {
id = "JiriHromek"
name = "Jiří Hromek"
url = "https://github.com/JiriHromek"
developers {
developer {
id.set("RealDanie1")
name.set("Daniel Pecuch")
url.set("https://github.com/RealDanie1")
}
developer {
id.set("RadekKuzel")
name.set("Radek Kůžel")
url.set("https://github.com/RadekKuzel")
}
developer {
id.set("JiriHromek")
name.set("Jiří Hromek")
url.set("https://github.com/JiriHromek")
}
developer {
id.set("gerak-cz")
name.set("Bořek Leikep")
url.set("https://github.com/gerak-cz")
}
}
developer {
id = "gerak-cz"
name = "Bořek Leikep"
url = "https://github.com/gerak-cz"
scm {
url.set("https://github.com/cleverlance/linguine/")
connection.set("scm:git:git://github.com/cleverlance/linguine.git")
developerConnection.set("scm:git:ssh://git@github.com:cleverlance/linguine.git")
}
}
scm {
url = "https://github.com/cleverlance/linguine/"
connection = "scm:git:git://github.com/cleverlance/linguine.git"
developerConnection = "scm:git:ssh://[email protected]:cleverlance/linguine.git"
}
}
} else {
tasks.withType<Sign>().configureEach {
enabled = false
}
}
}
Expand All @@ -84,7 +96,3 @@ tasks.withType<Detekt> {
}

// endregion

tasks.register<Delete>("clean") {
delete(rootProject.layout.buildDirectory)
}
4 changes: 2 additions & 2 deletions linguine-generator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ buildConfig {
gradlePlugin {
// Define the plugin
val linguine by plugins.creating {
id = "io.github.cleverlance.linguine"
implementationClass = "io.github.cleverlance.linguine.linguinegenerator.LinguinePlugin"
id = "com.qinshift.linguine"
implementationClass = "com.qinshift.linguine.linguinegenerator.LinguinePlugin"
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.cleverlance.linguine.linguinegenerator
package com.qinshift.linguine.linguinegenerator

import io.kotest.matchers.shouldBe
import kotlin.io.path.Path
import kotlin.test.Test
import kotlin.test.assertEquals
Expand Down Expand Up @@ -34,7 +35,7 @@ class FileContentGeneratorTest {
val expected = """
package presentation
import io.github.cleverlance.linguine.linguineruntime.presentation.Localiser.localise
import com.qinshift.linguine.linguineruntime.presentation.Localiser.localise
import kotlin.String
public object Settings {
Expand Down Expand Up @@ -71,7 +72,7 @@ class FileContentGeneratorTest {
val expected = """
package presentation
import io.github.cleverlance.linguine.linguineruntime.presentation.Localiser.localise
import com.qinshift.linguine.linguineruntime.presentation.Localiser.localise
import kotlin.String
public object Section {
Expand Down Expand Up @@ -105,7 +106,7 @@ class FileContentGeneratorTest {
val expected = """
package presentation
import io.github.cleverlance.linguine.linguineruntime.presentation.Localiser.localise
import com.qinshift.linguine.linguineruntime.presentation.Localiser.localise
import kotlin.String
public object Deep {
Expand Down Expand Up @@ -142,7 +143,7 @@ class FileContentGeneratorTest {
val expected = """
package presentation
import io.github.cleverlance.linguine.linguineruntime.presentation.Localiser.localise
import com.qinshift.linguine.linguineruntime.presentation.Localiser.localise
import kotlin.String
public object Strings {
Expand Down Expand Up @@ -175,7 +176,7 @@ class FileContentGeneratorTest {
val expected = """
package presentation
import io.github.cleverlance.linguine.linguineruntime.presentation.Localiser.localise
import com.qinshift.linguine.linguineruntime.presentation.Localiser.localise
import kotlin.Int
import kotlin.String
Expand Down Expand Up @@ -221,7 +222,7 @@ class FileContentGeneratorTest {
val expected = """
package presentation
import io.github.cleverlance.linguine.linguineruntime.presentation.Localiser.localise
import com.qinshift.linguine.linguineruntime.presentation.Localiser.localise
import kotlin.String
public object Strings {
Expand Down Expand Up @@ -296,7 +297,7 @@ class FileContentGeneratorTest {
val expected = """
package presentation
import io.github.cleverlance.linguine.linguineruntime.presentation.Localiser.localise
import com.qinshift.linguine.linguineruntime.presentation.Localiser.localise
import kotlin.String
public object Strings {
Expand Down Expand Up @@ -366,31 +367,31 @@ class FileContentGeneratorTest {
generator.generateFileContent(outputDirectory.resolve("Strings.kt"), "Strings", root)

val expected = """
package presentation
import io.github.cleverlance.linguine.linguineruntime.presentation.Localiser.localise
import kotlin.Float
import kotlin.Int
import kotlin.String
public object Strings {
public object Activation {
public object ForgottenPassword {
public object Birthdate {
public fun cancelButton(
param1: String,
param2: Int,
param3: Float,
param4: String,
param5: Int,
param6: Float,
): String = localise("activation__forgotten_password__birthdate__cancel_button",
param1, param2, param3, param4, param5, param6)
package presentation
import com.qinshift.linguine.linguineruntime.presentation.Localiser.localise
import kotlin.Float
import kotlin.Int
import kotlin.String
public object Strings {
public object Activation {
public object ForgottenPassword {
public object Birthdate {
public fun cancelButton(
param1: String,
param2: Int,
param3: Float,
param4: String,
param5: Int,
param6: Float,
): String = localise("activation__forgotten_password__birthdate__cancel_button",
param1, param2, param3, param4, param5, param6)
}
}
}
}
}
"""
assertEquals(expected.trimIndent(), result.trimIndent())
"""
result.trimIndent() shouldBe expected.trimIndent()
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.cleverlance.linguine.linguinegenerator
package com.qinshift.linguine.linguinegenerator

import io.kotest.matchers.shouldBe
import io.mockk.mockk
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.cleverlance.linguine.linguinegenerator
package com.qinshift.linguine.linguinegenerator

import io.kotest.matchers.shouldBe
import java.io.File
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.cleverlance.linguine.linguinegenerator
package com.qinshift.linguine.linguinegenerator

import java.io.File
import java.nio.file.Paths
Expand All @@ -23,7 +23,7 @@ class LinguinePluginFunctionalTest {
writeText(
"""
plugins {
id("io.github.cleverlance.linguine")
id("com.qinshift.linguine")
}
linguineConfig {
Expand Down Expand Up @@ -56,9 +56,9 @@ class LinguinePluginFunctionalTest {
testProjectDir.resolve(gradleBuildFileName).apply {
writeText(
"""
plugins {
id("io.github.cleverlance.linguine")
}
plugins {
id("com.qinshift.linguine")
}
linguineConfig {
inputFilePath = "src/main/resources/strings.json"
Expand Down Expand Up @@ -101,7 +101,7 @@ class LinguinePluginFunctionalTest {
val expectedContent = """
package presentation
import io.github.cleverlance.linguine.linguineruntime.presentation.Localiser.localise
import com.qinshift.linguine.linguineruntime.presentation.Localiser.localise
import kotlin.Float
import kotlin.Int
import kotlin.String
Expand Down Expand Up @@ -144,7 +144,7 @@ class LinguinePluginFunctionalTest {
val buildScript =
"""
plugins {
id("io.github.cleverlance.linguine")
id("com.qinshift.linguine")
}
linguineConfig {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.cleverlance.linguine.linguinegenerator.filereader
package com.qinshift.linguine.linguinegenerator.filereader

import java.io.File
import org.gradle.internal.impldep.junit.framework.TestCase.assertEquals
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.cleverlance.linguine.linguinegenerator
package com.qinshift.linguine.linguinegenerator

import com.squareup.kotlinpoet.FileSpec
import com.squareup.kotlinpoet.FunSpec
Expand Down Expand Up @@ -29,7 +29,7 @@ class FileContentGenerator(
return FileSpec.builder(getFilePackage(filePath), fileName)
.indent(DEFAULT_INDENT)
.addImport(
"io.github.cleverlance.linguine.linguineruntime.presentation",
"com.qinshift.linguine.linguineruntime.presentation",
"Localiser.localise",
)
.addType(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.cleverlance.linguine.linguinegenerator
package com.qinshift.linguine.linguinegenerator

class FileParser(
private val fileContent: Map<String, String>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.cleverlance.linguine.linguinegenerator
package com.qinshift.linguine.linguinegenerator

import java.io.File

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.cleverlance.linguine.linguinegenerator
package com.qinshift.linguine.linguinegenerator

import io.github.cleverlance.linguine.linguinegenerator.filereader.FileType
import com.qinshift.linguine.linguinegenerator.filereader.FileType

open class LinguineConfig {
var inputFilePath: String = ""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package io.github.cleverlance.linguine.linguinegenerator
package com.qinshift.linguine.linguinegenerator

import io.github.cleverlance.linguine.linguinegenerator.filereader.FileType as LinguineFileType
import com.qinshift.linguine.linguinegenerator.filereader.FileType as LinguineFileType
import org.gradle.api.provider.Property as GradleProperty
import io.github.cleverlance.linguine.linguine_generator.BuildConfig
import io.github.cleverlance.linguine.linguinegenerator.filereader.FileReader
import com.qinshift.linguine.linguine_generator.BuildConfig
import com.qinshift.linguine.linguinegenerator.filereader.FileReader
import org.gradle.api.DefaultTask
import org.gradle.api.Plugin
import org.gradle.api.Project
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.cleverlance.linguine.linguinegenerator.filereader
package com.qinshift.linguine.linguinegenerator.filereader

import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.qinshift.linguine.linguinegenerator.filereader

enum class FileType {
JSON
}

This file was deleted.

Loading

0 comments on commit 301c171

Please sign in to comment.