raydac / java-comment-preprocessor

preprocessor for computer languages with C-like comment format (C/C++/Java/Go)
Apache License 2.0
172 stars 27 forks source link

Gradle plugin: please consider exposing task parameters directly rather than via extension #21

Closed vlsi closed 4 years ago

vlsi commented 4 years ago

The current design allows having at most one jcp task per project which might be not enough.

What do you think if the task had its own parameters while the extension serves as the set of default values?

vlsi commented 4 years ago

Just in case, I've created my own task (see https://github.com/pgjdbc/pgjdbc/pull/1627 ): https://github.com/vlsi/pgjdbc/blob/gradle/buildSrc/src/main/kotlin/org/postgresql/buildtools/JavaCommentPreprocessorTask.kt

It more-or-less works, however, the configuration with baseDir+sourceFolders+excludedPatterns is kind of rigid.

Ant-like fileset would probably be easier to understand.


PS. you could have plugins { id("...") } in Gradle if you publish an extra .gradle.plugin artifact like https://repo1.maven.org/maven2/com/github/vlsi/checksum-dependency/com.github.vlsi.checksum-dependency.gradle.plugin/1.64/com.github.vlsi.checksum-dependency.gradle.plugin-1.64.pom

That is in your case the coordinates should be com.igormaznitsa.jcp:com.igormaznitsa.jcp.gradle.plugin pom artifact that adds a dependency on a regular jcp artifacts.

raydac commented 4 years ago

@vlsi I made some improvements to define and prefer task properties and use extension properties as default ones, take a look pls

raydac commented 4 years ago

so, since 7.0.3 there is no extension for Gradle task