Skip to content

Commit 6953101

Browse files
committed
Add logging.
1 parent bbbaeb3 commit 6953101

File tree

6 files changed

+25
-29
lines changed

6 files changed

+25
-29
lines changed

Diff for: .github/workflows/build-on-ubuntu.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ jobs:
2424

2525
- name: Build all libraries
2626
shell: bash
27-
run: ./gradlew build --stacktrace
27+
run: ./gradlew build --stacktrace -i

Diff for: .github/workflows/build-on-windows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jobs:
2929
- name: Build project and run tests
3030
shell: cmd
3131
# For the reason on `--no-daemon` see https://github.com/actions/cache/issues/454
32-
run: gradlew.bat build --stacktrace --no-daemon
32+
run: gradlew.bat build --stacktrace --no-daemon -i

Diff for: dependencies.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -751,4 +751,4 @@
751751

752752
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
753753

754-
This report was generated on **Wed Oct 16 08:54:33 EEST 2024** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
754+
This report was generated on **Wed Oct 16 13:01:22 EEST 2024** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).

Diff for: gradle-plugin/build.gradle.kts

+2-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ plugins {
3232
`java-gradle-plugin`
3333
`maven-publish`
3434
// id("com.gradle.plugin-publish") version "0.12.0"
35-
id("com.github.johnrengelman.shadow")
3635
}
3736

3837
repositories {
@@ -59,9 +58,7 @@ val functionalTestTask = tasks.register<Test>("functionalTest") {
5958
}
6059

6160
tasks.withType(Test::class) {
62-
useJUnitPlatform {
63-
includeEngines("junit-jupiter")
64-
}
61+
useJUnitPlatform {}
6562
}
6663

6764
tasks.named("test") {
@@ -106,7 +103,7 @@ gradlePlugin {
106103
displayName = "Chords Codegen Gradle Plugin"
107104
description = "A plugin that generates Kotlin extensions for Proto messages."
108105
implementationClass = "io.spine.chords.gradle.GradlePlugin"
109-
//tags.set(listOf("spine", "chords", "gradle", "plugin", "codegen"))
106+
//tags.set(listOf("spine", "chords", "gradle", "plugin", "codegen"))
110107
}
111108
}
112109
}

Diff for: gradle-plugin/src/main/kotlin/io/spine/chords/gradle/GradlePlugin.kt

+14-21
Original file line numberDiff line numberDiff line change
@@ -91,27 +91,26 @@ public class GradlePlugin : Plugin<Project> {
9191
}
9292
}
9393

94-
//val applyCodegenPlugins =
95-
project.tasks
94+
val applyCodegenPlugins = project.tasks
9695
.register("applyCodegenPlugins", ApplyCodegenPlugins::class.java) { task ->
9796
task.dependsOn(addGradleWrapperRunPermission)
9897
task.workspaceDir = workspaceDir.path
99-
task.dependencies(project.extension.dependencies)
10098
task.codegenPluginsArtifact = project.extension.codegenPluginsArtifact
99+
task.dependencies(project.extension.dependencies)
101100
}
102101

103-
// val compileKotlin = project.tasks.findByName("compileKotlin")
104-
// if (compileKotlin != null) {
105-
// compileKotlin.dependsOn(applyCodegenPlugins)
106-
// } else {
107-
// project.logger.warn(
108-
// """
109-
// Warning! `Chords-Gradle-plugin` will not be applied to module `${project.name}`.
110-
// Task `compileKotlin` not found, so required dependency was not added.
111-
// To generate code, execute the `applyCodegenPlugins` task before `compileKotlin`.
112-
// """.trimIndent()
113-
// )
114-
// }
102+
val compileKotlin = project.tasks.findByName("compileKotlin")
103+
if (compileKotlin != null) {
104+
compileKotlin.dependsOn(applyCodegenPlugins)
105+
} else {
106+
project.logger.warn(
107+
"""
108+
Warning! `Chords-Gradle-plugin` will not be applied to module `${project.name}`.
109+
Task `compileKotlin` not found, so required dependency was not added.
110+
To generate code, execute `applyCodegenPlugins` task before `compileKotlin`.
111+
"""
112+
)
113+
}
115114
}
116115

117116
/**
@@ -174,9 +173,3 @@ public fun File.unzipTo(
174173
}
175174
}
176175
}
177-
178-
/**
179-
* Obtains the extension the plugin added to this Gradle project.
180-
*/
181-
private val Project.extension: ParametersExtension
182-
get() = extensions.getByType(ParametersExtension::class.java)

Diff for: gradle-plugin/src/main/kotlin/io/spine/chords/gradle/ParametersExtension.kt

+6
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,9 @@ internal fun Project.createExtension(): ParametersExtension {
7575
extensions.add(ParametersExtension::class.java, extensionName, extension)
7676
return extension
7777
}
78+
79+
/**
80+
* Obtains the extension the plugin added to this Gradle project.
81+
*/
82+
internal val Project.extension: ParametersExtension
83+
get() = extensions.getByType(ParametersExtension::class.java)

0 commit comments

Comments
 (0)