Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process of migrating to gradle - Fix main class name for this project #465

Merged
merged 1 commit into from
Jun 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- `no-multi-spaces` rule (horizontal alignment of comments is no longer allowed) ([#269](https://github.com/shyiko/ktlint/issues/269)).
- `colon-spacing` rule (`:` must not appear at the beginning of the line).
- `package-name` rule (disabled until [#208](https://github.com/shyiko/ktlint/issues/208) is resolved).
- `--print-ast` to output [com.github.shyiko.ktlint.core.ast.ElementType.*](https://github.com/shyiko/ktlint/blob/master/ktlint-core/src/main/kotlin/com/github/shyiko/ktlint/core/ast/ElementType.kt) as `node.elementType`, e.g.
- `--print-ast` to output [com.pinterest.ktlint.core.ast.ElementType.*](https://github.com/shyiko/ktlint/blob/master/ktlint-core/src/main/kotlin/com/github/shyiko/ktlint/core/ast/ElementType.kt) as `node.elementType`, e.g.
```
$ echo 'fun f() {}' | ./ktlint/target/ktlint --print-ast --color --stdin
1: ~.psi.KtFile (FILE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import java.io.PrintStream
/**
* `ktlint` uses [ServiceLoader](http://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html) to
* discover all available [ReporterProvider]s on the classpath and so each [ReporterProvider] must be registered using
* `META-INF/services/com.github.shyiko.ktlint.core.ReporterProvider`
* `META-INF/services/com.pinterest.ktlint.core.ReporterProvider`
* (see `ktlint-reporter-plain/src/main/resources` for an example).
*/
interface ReporterProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.pinterest.ktlint.core
/**
* `ktlint` uses [ServiceLoader](http://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html) to
* discover all available `RuleSetProvider`s on the classpath and so each `RuleSetProvider` must be registered using
* `META-INF/services/com.github.shyiko.ktlint.core.RuleSetProvider`
* `META-INF/services/com.pinterest.ktlint.core.RuleSetProvider`
* (see `ktlint-ruleset-standard/src/main/resources` for an example).
*/
interface RuleSetProvider {
Expand Down
2 changes: 1 addition & 1 deletion ktlint-ruleset-template/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ dependencies {
}

task ktlint(type: JavaExec, dependsOn: classes) {
main = 'com.github.shyiko.ktlint.Main'
main = 'com.pinterest.ktlint.Main'
// adding compiled classes to the classpath so that ktlint would validate project's sources
// using its own ruleset (in other words to dogfood)
classpath = configurations.ktlint + sourceSets.main.output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class NoVarRuleTest : Spek({
describe("no-var rule") {

// whenever KTLINT_DEBUG env variable is set to "ast" or -DktlintDebug=ast is used
// com.github.shyiko.ktlint.test.(lint|format) will print AST (along with other debug info) to the stderr.
// com.pinterest.ktlint.test.(lint|format) will print AST (along with other debug info) to the stderr.
// this can be extremely helpful while writing and testing rules.
// uncomment the line below to take a quick look at it
// System.setProperty("ktlintDebug", "ast")
Expand Down
11 changes: 2 additions & 9 deletions ktlint/build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
plugins {
id 'org.jetbrains.kotlin.jvm'
id 'application'
// applied after mainClassName per https://github.com/johnrengelman/shadow/issues/336
id 'com.github.johnrengelman.shadow' version '4.0.2' apply false
}

apply plugin: 'com.github.johnrengelman.shadow'

shadowJar {
mainClassName = 'com.github.shyiko.ktlint.Main'
mergeServiceFiles {
include 'META-INF/services/com.github.shyiko.ktlint.core.*'
}
application {
mainClassName = 'com.pinterest.ktlint.Main'
}

dependencies {
Expand Down