1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

Remove public.

This commit is contained in:
Cedric Beust 2017-01-19 13:32:50 -08:00
parent 62b193f378
commit 48bbdfd1ff
13 changed files with 21 additions and 31 deletions

View file

@ -6,7 +6,7 @@ import com.beust.kobalt.api.annotation.Directive
import com.beust.kobalt.internal.JvmCompilerPlugin
@Directive
public fun project(vararg projects: Project, init: Project.() -> Unit): Project {
fun project(vararg projects: Project, init: Project.() -> Unit): Project {
return Project("").apply {
init()
(Kobalt.findPlugin(JvmCompilerPlugin.PLUGIN_NAME) as JvmCompilerPlugin)

View file

@ -9,7 +9,7 @@ import java.net.URLClassLoader
* Will probably be made obsolete by making the wrapper a standalone module instead of
* being inside Kobalt itself.
*/
public class ParentLastClassLoader(val classpath: List<URL>)
class ParentLastClassLoader(val classpath: List<URL>)
: ClassLoader(Thread.currentThread().contextClassLoader) {
private val childClassLoader: ChildURLClassLoader
@ -22,7 +22,7 @@ public class ParentLastClassLoader(val classpath: List<URL>)
* This class makes it possible to call findClass on a classloader
*/
private class FindClassClassLoader(parent: ClassLoader) : ClassLoader(parent) {
override public fun findClass(name: String) = super.findClass(name)
override fun findClass(name: String) = super.findClass(name)
}
/**
@ -32,7 +32,7 @@ public class ParentLastClassLoader(val classpath: List<URL>)
private class ChildURLClassLoader(urls: Array<URL>, val realParent: FindClassClassLoader)
: URLClassLoader(urls, null) {
override public fun findClass(name: String) : Class<*> {
override fun findClass(name: String) : Class<*> {
try {
// first try to use the URLClassLoader findClass
return super.findClass(name)
@ -43,7 +43,7 @@ public class ParentLastClassLoader(val classpath: List<URL>)
}
}
override public @Synchronized fun loadClass(name: String, resolve: Boolean) : Class<*> {
override @Synchronized fun loadClass(name: String, resolve: Boolean) : Class<*> {
try {
// first we try to find a class inside the child classloader
return childClassLoader.findClass(name)

View file

@ -3,7 +3,7 @@ package com.beust.kobalt.maven
import java.util.concurrent.Future
import java.util.concurrent.TimeUnit
public class CompletedFuture<T>(val value: T) : Future<T> {
class CompletedFuture<T>(val value: T) : Future<T> {
override fun cancel(mayInterruptIfRunning: Boolean) = true
override fun get(): T = value
override fun get(timeout: Long, unit: TimeUnit): T = value

View file

@ -10,7 +10,7 @@ import java.io.File
import java.io.InputStreamReader
@Singleton
public class Gpg {
class Gpg {
val COMMANDS = listOf("gpg", "gpg2")
fun findGpgCommand() : String? {

View file

@ -1,6 +1,6 @@
package com.beust.kobalt.maven
open public class LocalDep(override val mavenId: MavenId, open val localRepo: LocalRepo)
open class LocalDep(override val mavenId: MavenId, open val localRepo: LocalRepo)
: SimpleDep(mavenId) {
fun toAbsoluteJarFilePath(v: String) = localRepo.toFullPath(toJarFile(v))

View file

@ -12,7 +12,7 @@ import java.util.zip.ZipEntry
import java.util.zip.ZipFile
import java.util.zip.ZipOutputStream
public class JarUtils {
class JarUtils {
companion object {
val DEFAULT_HANDLER: (Exception) -> Unit = { ex: Exception ->
// Ignore duplicate entry exceptions
@ -150,7 +150,7 @@ class IncludedFile(val fromOriginal: From, val toOriginal: To, val specs: List<I
val from: String get() = fromOriginal.path.replace("\\", "/")
fun to(s: String) = File(if (toOriginal.isCurrentDir()) s else KFiles.joinDir(to, s))
val to: String get() = toOriginal.path.replace("\\", "/")
override public fun toString() = toString("IncludedFile",
override fun toString() = toString("IncludedFile",
"files - ", specs.map { it.toString() },
"from", from,
"to", to)

View file

@ -1,10 +1,10 @@
package com.beust.kobalt.misc
public data class Node<T>(val value: T) {
data class Node<T>(val value: T) {
val children = arrayListOf<Node<T>>()
var parent: Node<T>? = null
public fun addChildren(values: List<Node<T>>) {
fun addChildren(values: List<Node<T>>) {
values.forEach {
it.parent = this
children.add(it)
@ -15,12 +15,12 @@ public data class Node<T>(val value: T) {
println(s)
}
public fun dump(r: T, children: List<Node<T>>, indent: Int) {
fun dump(r: T, children: List<Node<T>>, indent: Int) {
p(" ".repeat(indent) + r)
children.forEach { dump(it.value, it.children, indent + 2) }
}
public fun dump(indent: Int = 0) {
fun dump(indent: Int = 0) {
dump(value, children, indent)
}
}

View file

@ -32,7 +32,7 @@ import javax.inject.Inject
* 1) Extract the repos() and plugins() statements in a separate .kt and compile it into preBuildScript.jar.
* 2) Actually build the whole Build.kt file after adding to the classpath whatever phase 1 found (plugins, repos)
*/
public class BuildFileCompiler @Inject constructor(@Assisted("buildFiles") val buildFiles: List<BuildFile>,
class BuildFileCompiler @Inject constructor(@Assisted("buildFiles") val buildFiles: List<BuildFile>,
@Assisted val pluginInfo: PluginInfo, val files: KFiles, val plugins: Plugins,
val dependencyManager: DependencyManager, val pluginProperties: PluginProperties,
val executors: KobaltExecutors, val buildScriptUtil: BuildScriptUtil, val settings: KobaltSettings,

View file

@ -65,7 +65,7 @@ open class MainModule(val args: Args, val settings: KobaltSettings) : AbstractMo
// bindListener(Matchers.any(), object: TypeListener {
// override fun <I> hear(typeLiteral: TypeLiteral<I>?, typeEncounter: TypeEncounter<I>?) {
// val bean = object: InjectionListener<I> {
// override public fun afterInjection(injectee: I) {
// override fun afterInjection(injectee: I) {
// if (Scopes.isCircularProxy(injectee)) {
// println("CYCLE: " + typeLiteral?.getRawType()?.getName());
// }

View file

@ -72,7 +72,7 @@ class JavaPlugin @Inject constructor(val javaCompiler: JavaCompiler, override va
}
@Directive
public fun javaProject(vararg projects: Project, init: Project.() -> Unit): Project {
fun javaProject(vararg projects: Project, init: Project.() -> Unit): Project {
return Project().apply {
warn("javaProject{} is deprecated, please use project{}")
init()

View file

@ -8,7 +8,7 @@ import org.testng.annotations.Guice
open class KobaltTest {
companion object {
@BeforeSuite
public fun bs() {
fun bs() {
Kobalt.INJECTOR = com.google.inject.Guice.createInjector(TestModule())
}
}

View file

@ -29,17 +29,17 @@ class DependencyTest @Inject constructor(val executors: KobaltExecutors) {
private var executor: ExecutorService by Delegates.notNull()
@BeforeClass
public fun bc() {
fun bc() {
executor = executors.newExecutor("DependencyTest", 5)
}
@AfterClass
public fun ac() {
fun ac() {
executor.shutdown()
}
@Test(dataProvider = "dpVersions")
public fun versionSorting(k: String, v: String) {
fun versionSorting(k: String, v: String) {
val dep1 = Versions.toLongVersion(k)
val dep2 = Versions.toLongVersion(v)
Assert.assertTrue(dep1.compareTo(dep2) < 0)

View file

@ -1,10 +0,0 @@
package com.beust.kobalt.maven
//import org.junit.Test
//
//public class JUnitTest {
// @Test
// public fun simpleTestForJUnit() {
// println("Works")
// }
//}