Revert "Rename "import jet.*" to "import kotlin.*" on ant dist"
This reverts commit 4a5823c5bb.
This commit is contained in:
@@ -284,26 +284,6 @@
|
||||
<arg value="core/builtins/native"/>
|
||||
<arg value="core/builtins/src"/>
|
||||
</java>
|
||||
|
||||
<if>
|
||||
<isfalse value="${bootstrap.build.no.tests}"/>
|
||||
<then>
|
||||
<cleandir dir="${output}/renameImportJet"/>
|
||||
<kotlinc output="${output}/renameImportJet">
|
||||
<src path="renameImportJet.kt"/>
|
||||
<classpath refid="classpath"/>
|
||||
</kotlinc>
|
||||
<java classname="_DefaultPackage" failonerror="true" fork="true">
|
||||
<classpath>
|
||||
<pathelement location="${output}/renameImportJet"/>
|
||||
<path refid="classpath"/>
|
||||
</classpath>
|
||||
<assertions>
|
||||
<enable/>
|
||||
</assertions>
|
||||
</java>
|
||||
</then>
|
||||
</if>
|
||||
</target>
|
||||
|
||||
<macrodef name="pack_compiler">
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
import java.io.File
|
||||
import com.intellij.util.Processor
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import java.util.ArrayList
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
println("renameImportJet")
|
||||
|
||||
fun processFile(file: File) {
|
||||
if (!file.getName().endsWith(".java") || file.isDirectory()) return
|
||||
|
||||
val lines = ArrayList<String>()
|
||||
var rewrite = false
|
||||
file.reader().forEachLine { line ->
|
||||
if (line.startsWith("import jet.") && !line.startsWith("import jet.runtime.typeinfo")) {
|
||||
lines.add("import kotlin." + line.substring("import jet.".length))
|
||||
rewrite = true
|
||||
}
|
||||
else {
|
||||
lines.add(line)
|
||||
}
|
||||
}
|
||||
|
||||
if (rewrite) {
|
||||
println("renaming imports in $file")
|
||||
file.writeText(lines reduce { (a, b) -> "$a\n$b" })
|
||||
}
|
||||
}
|
||||
|
||||
val processor = Processor<File> { if (it != null) processFile(it); true }
|
||||
val directoryFilter = Processor<File> { it?.getName() != "testData" }
|
||||
|
||||
FileUtil.processFilesRecursively(File("."), processor, directoryFilter)
|
||||
}
|
||||
Reference in New Issue
Block a user