-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically apply the mappie dependency via the Gradle plugin (#149)
- Loading branch information
1 parent
b619935
commit 608ccae
Showing
12 changed files
with
165 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
src/main/resources/version.properties | ||
src/main/resources/mappie.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
gradle-plugin/src/main/kotlin/tech/mappie/MappieProperties.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package tech.mappie | ||
|
||
import java.util.Properties | ||
|
||
object MappieProperties { | ||
|
||
private val properties = javaClass.classLoader.getResourceAsStream("mappie.properties").use { | ||
Properties().apply { load(it) } | ||
} | ||
|
||
val version = properties["VERSION"] as String | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...in/src/test/kotlin/tech/mappie/testing/compatibility/gradle/Gradle812CompatibilityTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package tech.mappie.testing.compatibility.gradle | ||
|
||
import org.junit.jupiter.api.Test | ||
|
||
class Gradle812CompatibilityTest : GradleCompatibilityTestBase() { | ||
|
||
override val gradleVersion = "8.12" | ||
|
||
@Test | ||
fun `test compatibility with gradle 8_12`() { | ||
runner.withArguments("build").build() | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
.../kotlin/tech/mappie/testing/compatibility/multiplatform/MultiplatformCompatibilityTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package tech.mappie.testing.compatibility.multiplatform | ||
|
||
import org.junit.jupiter.api.Test | ||
import tech.mappie.testing.KotlinPlatform | ||
import tech.mappie.testing.TestBase | ||
|
||
class MultiplatformCompatibilityTest : TestBase() { | ||
|
||
override val platform = KotlinPlatform.MULTIPLATFORM | ||
|
||
@Test | ||
fun `test compatibility with multiplatform`() { | ||
kotlin("src/commonMain/kotlin/CommonMapper.kt", | ||
""" | ||
import tech.mappie.api.ObjectMappie | ||
data class CommonInput(val string: String) | ||
data class CommonOutput(val string: String) | ||
object CommonMapper : ObjectMappie<CommonInput, CommonOutput>() | ||
""".trimIndent() | ||
) | ||
|
||
kotlin("src/commonTest/kotlin/CommonMapperTest.kt", | ||
""" | ||
import kotlin.test.* | ||
class CommonMapperTest { | ||
@Test | ||
fun `map CommonInput to CommonOutput`() { | ||
assertEquals( | ||
CommonOutput("value"), | ||
CommonMapper.map(CommonInput("value")), | ||
) | ||
} | ||
} | ||
""".trimIndent() | ||
) | ||
|
||
kotlin("src/jvmMain/kotlin/JvmMapper.kt", | ||
""" | ||
import tech.mappie.api.ObjectMappie | ||
data class JvmInput(val string: String, val int: Int) | ||
data class JvmOutput(val string: String, val int: Int) | ||
object JvmMapper : ObjectMappie<JvmInput, JvmOutput>() | ||
""".trimIndent() | ||
) | ||
|
||
runner.withArguments("build").build() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
version=0.10.0 | ||
version=0.11.0-SNAPSHOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters