Skip to content

Commit

Permalink
Fixed compile issue with ktlint 0.45.0
Browse files Browse the repository at this point in the history
`ReporterProvider` API change.
  • Loading branch information
freemanjp committed Mar 28, 2022
1 parent e03eee6 commit 6cb0cc9
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .idea/encodings.xml

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

6 changes: 6 additions & 0 deletions .idea/google-java-format.xml

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

20 changes: 20 additions & 0 deletions .idea/jarRepositories.xml

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

Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,16 @@
* THE SOFTWARE.
* #L%
*/
package com.github.gantsign.maven.plugin.ktlint.internal
package com.github.gantsign.maven.plugin.ktlint

import com.pinterest.ktlint.core.LintError
import com.pinterest.ktlint.core.Reporter
import java.io.File
import java.util.ArrayList
import java.util.concurrent.ConcurrentHashMap
import org.apache.maven.plugin.logging.Log
import org.apache.maven.shared.utils.logging.MessageUtils

internal class MavenLogReporter(
class MavenLogReporter(
val log: Log,
val verbose: Boolean,
val groupByFile: Boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,18 @@
*/
package com.github.gantsign.maven.plugin.ktlint

import com.github.gantsign.maven.plugin.ktlint.internal.MavenLogReporter
import com.pinterest.ktlint.core.Reporter
import com.pinterest.ktlint.core.ReporterProvider
import java.io.PrintStream
import org.apache.maven.plugin.logging.Log

class MavenLogReporterProvider : ReporterProvider {
class MavenLogReporterProvider : ReporterProvider<MavenLogReporter> {

override val id: String = "maven"

override fun get(out: PrintStream, opt: Map<String, String>): Reporter =
override fun get(out: PrintStream, opt: Map<String, String>): MavenLogReporter =
throw UnsupportedOperationException("Use MavenLogReporterProvider.get(Log, Map<String, String>) instead.")

fun get(log: Log, opt: Map<String, String>): Reporter =
fun get(log: Log, opt: Map<String, String>): MavenLogReporter =
MavenLogReporter(
log = log,
verbose = opt["verbose"].emptyOrTrue(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/
package com.github.gantsign.maven.plugin.ktlint.internal

import com.github.gantsign.maven.plugin.ktlint.MavenLogReporter
import com.github.gantsign.maven.plugin.ktlint.ReporterConfig
import java.io.File
import java.nio.charset.Charset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down

0 comments on commit 6cb0cc9

Please sign in to comment.