Skip to content

Commit b72ea1f

Browse files
committed
ant: cleanup 'public', property access syntax
1 parent e47e9f6 commit b72ea1f

File tree

4 files changed

+35
-35
lines changed

4 files changed

+35
-35
lines changed

ant/src/org/jetbrains/kotlin/ant/Kotlin2JsTask.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@ package org.jetbrains.kotlin.ant
1919
import org.apache.tools.ant.types.Path
2020
import java.io.File
2121

22-
public class Kotlin2JsTask : KotlinCompilerBaseTask() {
22+
class Kotlin2JsTask : KotlinCompilerBaseTask() {
2323
override val compilerFqName = "org.jetbrains.kotlin.cli.js.K2JSCompiler"
2424

25-
public var library: Path? = null
26-
public var outputPrefix: File? = null
27-
public var outputPostfix: File? = null
28-
public var sourceMap: Boolean = false
29-
public var metaInfo: Boolean = false
25+
var library: Path? = null
26+
var outputPrefix: File? = null
27+
var outputPostfix: File? = null
28+
var sourceMap: Boolean = false
29+
var metaInfo: Boolean = false
3030

3131
/**
3232
* {@link K2JsArgumentConstants.CALL} (default) if need generate a main function call (main function will be auto detected)
3333
* {@link K2JsArgumentConstants.NO_CALL} otherwise.
3434
*/
35-
public var main: String? = null
35+
var main: String? = null
3636

37-
public fun createLibrary(): Path {
37+
fun createLibrary(): Path {
3838
val libraryPath = library
3939
if (libraryPath == null) {
4040
val t = Path(getProject())

ant/src/org/jetbrains/kotlin/ant/Kotlin2JvmTask.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ import org.apache.tools.ant.types.Path
2020
import org.apache.tools.ant.types.Reference
2121
import java.io.File.pathSeparator
2222

23-
public class Kotlin2JvmTask : KotlinCompilerBaseTask() {
23+
class Kotlin2JvmTask : KotlinCompilerBaseTask() {
2424
override val compilerFqName = "org.jetbrains.kotlin.cli.jvm.K2JVMCompiler"
2525

26-
public var includeRuntime: Boolean = true
27-
public var moduleName: String? = null
26+
var includeRuntime: Boolean = true
27+
var moduleName: String? = null
2828

2929
private var compileClasspath: Path? = null
3030

31-
public fun setClasspath(classpath: Path) {
31+
fun setClasspath(classpath: Path) {
3232
if (compileClasspath == null) {
3333
compileClasspath = classpath
3434
}
@@ -37,14 +37,14 @@ public class Kotlin2JvmTask : KotlinCompilerBaseTask() {
3737
}
3838
}
3939

40-
public fun setClasspathRef(ref: Reference) {
40+
fun setClasspathRef(ref: Reference) {
4141
if (compileClasspath == null) {
4242
compileClasspath = Path(getProject())
4343
}
44-
compileClasspath!!.createPath().setRefid(ref)
44+
compileClasspath!!.createPath().refid = ref
4545
}
4646

47-
public fun addConfiguredClasspath(classpath: Path) {
47+
fun addConfiguredClasspath(classpath: Path) {
4848
setClasspath(classpath)
4949
}
5050

ant/src/org/jetbrains/kotlin/ant/KotlinAntTaskUtil.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ object KotlinAntTaskUtil {
2929

3030
private val libPath: File by lazy {
3131
// Find path of kotlin-ant.jar in the filesystem and find kotlin-compiler.jar in the same directory
32-
val resourcePath = "/" + javaClass.getName().replace('.', '/') + ".class"
32+
val resourcePath = "/" + javaClass.name.replace('.', '/') + ".class"
3333
val jarConnection = javaClass.getResource(resourcePath).openConnection() as? JarURLConnection
3434
?: throw UnsupportedOperationException("Kotlin compiler Ant task should be loaded from the JAR file")
35-
val antTaskJarPath = File(jarConnection.getJarFileURL().toURI())
35+
val antTaskJarPath = File(jarConnection.jarFileURL.toURI())
3636

37-
antTaskJarPath.getParentFile()
37+
antTaskJarPath.parentFile
3838
}
3939

4040
val compilerJar: File by lazy {
@@ -47,7 +47,7 @@ object KotlinAntTaskUtil {
4747

4848
private fun File.assertExists(): File {
4949
if (!this.exists()) {
50-
throw IllegalStateException("${getName()} is not found in the directory of Kotlin Ant task")
50+
throw IllegalStateException("${name} is not found in the directory of Kotlin Ant task")
5151
}
5252
return this
5353
}
@@ -68,5 +68,5 @@ object KotlinAntTaskUtil {
6868

6969
}
7070

71-
public val Task.defaultModuleName: String?
71+
val Task.defaultModuleName: String?
7272
get() = owningTarget?.name ?: project?.name

ant/src/org/jetbrains/kotlin/ant/KotlinCompilerBaseTask.kt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,25 @@ import org.apache.tools.ant.types.Reference
2424
import java.io.File
2525
import java.io.PrintStream
2626

27-
public abstract class KotlinCompilerBaseTask : Task() {
27+
abstract class KotlinCompilerBaseTask : Task() {
2828
protected abstract val compilerFqName: String
2929

30-
public val args: MutableList<String> = arrayListOf()
30+
val args: MutableList<String> = arrayListOf()
3131

32-
public var src: Path? = null
33-
public var output: File? = null
34-
public var nowarn: Boolean = false
35-
public var verbose: Boolean = false
36-
public var printVersion: Boolean = false
37-
public var failOnError: Boolean = true
32+
var src: Path? = null
33+
var output: File? = null
34+
var nowarn: Boolean = false
35+
var verbose: Boolean = false
36+
var printVersion: Boolean = false
37+
var failOnError: Boolean = true
3838

39-
public var noStdlib: Boolean = false
39+
var noStdlib: Boolean = false
4040

41-
public val additionalArguments: MutableList<Commandline.Argument> = arrayListOf()
41+
val additionalArguments: MutableList<Commandline.Argument> = arrayListOf()
4242

43-
public var exitCode: Int? = null
43+
var exitCode: Int? = null
4444

45-
public fun createSrc(): Path {
45+
fun createSrc(): Path {
4646
val srcPath = src
4747
if (srcPath == null) {
4848
val t = Path(getProject())
@@ -53,19 +53,19 @@ public abstract class KotlinCompilerBaseTask : Task() {
5353
return srcPath.createPath()
5454
}
5555

56-
public fun setSrcRef(ref: Reference) {
56+
fun setSrcRef(ref: Reference) {
5757
createSrc().refid = ref
5858
}
5959

60-
public fun createCompilerArg(): Commandline.Argument {
60+
fun createCompilerArg(): Commandline.Argument {
6161
val argument = Commandline.Argument()
6262
additionalArguments.add(argument)
6363
return argument
6464
}
6565

6666
abstract fun fillSpecificArguments()
6767

68-
public fun fillArguments() {
68+
fun fillArguments() {
6969
val sourcePaths = src ?: throw BuildException("\"src\" should be specified")
7070
args.addAll(sourcePaths.list().map { File(it).canonicalPath })
7171

0 commit comments

Comments
 (0)