Rearrange kotlin-stdlib-js library sources

Move kotlin.* api inside kotlin directory.
Update copyright paths.
This commit is contained in:
Ilya Gorbunov
2018-01-31 06:40:35 +03:00
committed by Stanislav Erokhin
parent 57e47d1830
commit 00b23a0fe9
114 changed files with 31 additions and 25 deletions
-1
View File
@@ -1 +0,0 @@
js.libraries
+16 -9
View File
@@ -17,9 +17,9 @@ def commonSrcDir = "${buildDir}/common-sources"
def commonTestSrcDir = "${buildDir}/common-test-sources" def commonTestSrcDir = "${buildDir}/common-test-sources"
def builtinsDir = "${rootDir}/core/builtins" def builtinsDir = "${rootDir}/core/builtins"
def experimentalSrcDir = "${rootDir}/libraries/stdlib/experimental" def experimentalSrcDir = "${rootDir}/libraries/stdlib/experimental"
def jsLibrariesDir = "${rootDir}/js/js.libraries" def jsSrcGeneratedDir = "${rootDir}/js/js.libraries/src/core/generated" // to be removed soon
def jsSrcDir = "${jsLibrariesDir}/src" def jsSrcDir = "src"
def jsTestSrcDir = "${jsLibrariesDir}/test" def jsTestSrcDir = "test"
def jsSrcJsDir = "${jsSrcDir}/js" def jsSrcJsDir = "${jsSrcDir}/js"
def jsOutputFile = "${buildDir}/classes/kotlin.js" def jsOutputFile = "${buildDir}/classes/kotlin.js"
@@ -34,7 +34,7 @@ sourceSets {
builtins { builtins {
kotlin { kotlin {
srcDir builtinsSrcDir2 srcDir builtinsSrcDir2
srcDir "${jsSrcDir}/builtins" srcDir 'runtime'
} }
} }
@@ -42,7 +42,7 @@ sourceSets {
kotlin { kotlin {
srcDir builtinsSrcDir srcDir builtinsSrcDir
srcDir jsSrcDir srcDir jsSrcDir
exclude "builtins" srcDir jsSrcGeneratedDir
srcDir commonSrcDir srcDir commonSrcDir
} }
} }
@@ -143,7 +143,7 @@ compileKotlin2Js {
outputFile = "${buildDir}/classes/main/kotlin.js" outputFile = "${buildDir}/classes/main/kotlin.js"
sourceMap = true sourceMap = true
sourceMapPrefix = "./" sourceMapPrefix = "./"
freeCompilerArgs += [ "-source-map-base-dirs", [builtinsSrcDir, jsSrcDir, commonSrcDir ].join(File.pathSeparator) ] freeCompilerArgs += [ "-source-map-base-dirs", [builtinsSrcDir, jsSrcDir, commonSrcDir].collect { file(it).absoluteFile }.join(File.pathSeparator) ]
} }
} }
@@ -212,17 +212,20 @@ task compileJs(type: JavaExec) {
def sourceMapBasePaths = [ def sourceMapBasePaths = [
"./", "./",
"/js.libraries/src/js/" "libraries/stdlib/js/src/js/",
"libraries/stdlib/js/src/",
] ]
sourceMap.sources = sourceMap.sources.collect { sourcePath -> sourceMap.sources = sourceMap.sources.collect { sourcePath ->
def prefixToRemove = sourceMapBasePaths.find { basePath -> sourcePath.startsWith(basePath) } def prefixToRemove = sourceMapBasePaths.find { basePath -> sourcePath.startsWith(basePath) }
if (prefixToRemove != null) sourcePath.substring(prefixToRemove.length()) else sourcePath if (prefixToRemove != null) sourcePath.substring(prefixToRemove.length()) else sourcePath
} }
def sourceMapSourcesBaseDirs = [ jsSrcDir, builtinsSrcDir2, builtinsSrcDir, commonSrcDir, rootDir ] def sourceMapSourcesBaseDirs = [jsSrcDir, jsSrcJsDir, jsSrcGeneratedDir, builtinsSrcDir, commonSrcDir, projectDir]
sourceMap.sourcesContent = sourceMap.sources.collect { sourceName -> sourceMap.sourcesContent = sourceMap.sources.collect { sourceName ->
sourceMapSourcesBaseDirs.collect { file("$it/$sourceName") }.find { it.exists() && it.name != "kotlin.js" }?.text def text = sourceMapSourcesBaseDirs.collect { file("$it/$sourceName") }.find { it.exists() }?.text
if (text == null) logger.warn("Sources missing for file $sourceName")
text
} }
sourceMapFile.text = groovy.json.JsonOutput.toJson(sourceMap) sourceMapFile.text = groovy.json.JsonOutput.toJson(sourceMap)
@@ -263,8 +266,12 @@ task sourcesJar(type: Jar, dependsOn: classes) {
from (sourceSets.main.allSource) { from (sourceSets.main.allSource) {
into 'kotlin' into 'kotlin'
exclude '**/*.java' exclude '**/*.java'
exclude 'org.w3c/**'
exclude 'js/**' exclude 'js/**'
} }
from (sourceSets.main.allSource) {
include 'org.w3c/**'
}
from (sourceSets.experimental.allSource) { from (sourceSets.experimental.allSource) {
into 'kotlin' into 'kotlin'
} }

Some files were not shown because too many files have changed in this diff Show More