mirror of
https://github.com/ethauvin/kobalt-line-count.git
synced 2025-04-24 18:57:11 -07:00
Upgrade to 0.154.
This commit is contained in:
parent
34dcabbeb9
commit
72d27ac7d4
7 changed files with 34 additions and 16 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
|||
.idea
|
||||
.kobalt
|
||||
|
||||
kobaltBuild
|
||||
local.properties
|
||||
|
|
18
Build.kt
18
Build.kt
|
@ -1,24 +1,36 @@
|
|||
import com.beust.kobalt.*
|
||||
import com.beust.kobalt.plugin.packaging.*
|
||||
import com.beust.kobalt.plugin.kotlin.*
|
||||
import com.beust.kobalt.plugin.publish.*
|
||||
|
||||
|
||||
val repos = repos("https://dl.bintray.com/cbeust/maven/")
|
||||
|
||||
val plugins = plugins(
|
||||
"com.beust.kobalt:kobalt-line-count:0.8"
|
||||
// file("/Users/beust/kotlin/kobalt-line-count/kobaltBuild/libs/kobalt-line-count-0.6.jar")
|
||||
)
|
||||
|
||||
val project = kotlinProject {
|
||||
name = "kobalt-line-count"
|
||||
group = "com.beust.kobalt"
|
||||
artifactId = name
|
||||
version = "0.2"
|
||||
version = "0.8"
|
||||
|
||||
dependencies {
|
||||
compile("com.beust:kobalt:0.139")
|
||||
compile("com.beust:kobalt:0.15")
|
||||
}
|
||||
}
|
||||
|
||||
val packProject = assemble(project) {
|
||||
jar {
|
||||
mavenJars {
|
||||
manifest {
|
||||
attributes("Kobalt-Plugin-Class", "com.beust.kobalt.plugin.linecount.Main")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val jc = jcenter(project) {
|
||||
publish = true
|
||||
}
|
||||
|
||||
|
|
|
@ -44,5 +44,6 @@
|
|||
<orderEntry type="library" name="Gradle: javax.inject:javax.inject:1" level="project" />
|
||||
<orderEntry type="library" name="Gradle: aopalliance:aopalliance:1.0" level="project" />
|
||||
<orderEntry type="library" name="Gradle: org.codehaus.plexus:plexus-utils:3.0.20" level="project" />
|
||||
<orderEntry type="library" name="kobalt-0.153" level="project" />
|
||||
</component>
|
||||
</module>
|
Binary file not shown.
|
@ -1 +1 @@
|
|||
kobalt.version=0.139
|
||||
kobalt.version=0.154
|
3
kobaltw
3
kobaltw
|
@ -1 +1,2 @@
|
|||
java -jar kobalt/wrapper/kobalt-wrapper.jar $*
|
||||
java -jar kobalt/wrapper/kobalt-wrapper.jar $*
|
||||
|
||||
|
|
|
@ -23,17 +23,20 @@ public class Main : BasePlugin(), KobaltLogger {
|
|||
var lineCount : Long = 0
|
||||
val matcher = FileSystems.getDefault().getPathMatcher("glob:**.kt")
|
||||
project.sourceDirectories.forEach {
|
||||
Files.walkFileTree(Paths.get(it), object: SimpleFileVisitor<Path>() {
|
||||
override public fun visitFile(path: Path, attrs: BasicFileAttributes): FileVisitResult {
|
||||
log(2, "File: ${path}")
|
||||
if (matcher.matches(path)) {
|
||||
fileCount++
|
||||
lineCount += Files.lines(path).count()
|
||||
log(2, " MATCH")
|
||||
val path = Paths.get(it)
|
||||
if (path.toFile().exists()) {
|
||||
Files.walkFileTree(path, object : SimpleFileVisitor<Path>() {
|
||||
override public fun visitFile(path: Path, attrs: BasicFileAttributes): FileVisitResult {
|
||||
log(2, "File: ${path}")
|
||||
if (matcher.matches(path)) {
|
||||
fileCount++
|
||||
lineCount += Files.lines(path).count()
|
||||
log(2, " MATCH")
|
||||
}
|
||||
return FileVisitResult.CONTINUE
|
||||
}
|
||||
return FileVisitResult.CONTINUE
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
log(1, "Found ${lineCount} lines in ${fileCount} files")
|
||||
return TaskResult()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue