parent
8bb1f1554b
commit
765d1db9a9
@ -0,0 +1,4 @@ |
||||
.gradle |
||||
.idea |
||||
build |
||||
node_modules |
@ -0,0 +1,28 @@ |
||||
buildscript { |
||||
repositories { |
||||
jcenter() |
||||
maven { url "http://kotlin.bintray.com/kotlinx" } |
||||
maven { url "https://plugins.gradle.org/m2/" } |
||||
} |
||||
dependencies { |
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" |
||||
classpath "com.moowork.gradle:gradle-node-plugin:$gradle_node_version" |
||||
} |
||||
} |
||||
|
||||
allprojects { |
||||
group 'org.jetbrains' |
||||
version '1.0-SNAPSHOT' |
||||
|
||||
repositories { |
||||
jcenter() |
||||
maven { url "http://kotlin.bintray.com/kotlinx" } |
||||
} |
||||
|
||||
tasks.withType(Test) { |
||||
testLogging { |
||||
showStandardStreams = true |
||||
events "passed", "failed" |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,7 @@ |
||||
apply plugin: 'kotlin-platform-common' |
||||
|
||||
dependencies { |
||||
compile "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version" |
||||
testCompile "org.jetbrains.kotlin:kotlin-test-annotations-common:$kotlin_version" |
||||
testCompile "org.jetbrains.kotlin:kotlin-test-common:$kotlin_version" |
||||
} |
@ -0,0 +1,6 @@ |
||||
|
||||
// This code is common across all backends |
||||
class Common { |
||||
fun common(): String = "common" |
||||
fun platform(): String = Platform().platform() // delegates to platform-specific |
||||
} |
@ -0,0 +1,5 @@ |
||||
|
||||
// This class is expected to have platform-specific impl |
||||
expect class Platform() { |
||||
fun platform(): String |
||||
} |
@ -0,0 +1,13 @@ |
||||
import kotlin.test.* |
||||
|
||||
class CommonTest { |
||||
@Test |
||||
fun testCommon() { |
||||
assertEquals("common", Common().common()) |
||||
} |
||||
|
||||
@Test |
||||
fun testPlatform() { |
||||
assertTrue(Common().platform().startsWith("platform-")) |
||||
} |
||||
} |
@ -0,0 +1,7 @@ |
||||
kotlin_version = 1.2.20 |
||||
|
||||
gradle_node_version = 1.2.0 |
||||
node_version = 8.9.3 |
||||
npm_version = 5.5.1 |
||||
|
||||
kotlin.incremental.multiplatform=true |
Binary file not shown.
@ -0,0 +1,6 @@ |
||||
#Wed Jan 24 17:11:50 MSK 2018 |
||||
distributionBase=GRADLE_USER_HOME |
||||
distributionPath=wrapper/dists |
||||
zipStoreBase=GRADLE_USER_HOME |
||||
zipStorePath=wrapper/dists |
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip |
@ -0,0 +1,172 @@ |
||||
#!/usr/bin/env sh |
||||
|
||||
############################################################################## |
||||
## |
||||
## Gradle start up script for UN*X |
||||
## |
||||
############################################################################## |
||||
|
||||
# Attempt to set APP_HOME |
||||
# Resolve links: $0 may be a link |
||||
PRG="$0" |
||||
# Need this for relative symlinks. |
||||
while [ -h "$PRG" ] ; do |
||||
ls=`ls -ld "$PRG"` |
||||
link=`expr "$ls" : '.*-> \(.*\)$'` |
||||
if expr "$link" : '/.*' > /dev/null; then |
||||
PRG="$link" |
||||
else |
||||
PRG=`dirname "$PRG"`"/$link" |
||||
fi |
||||
done |
||||
SAVED="`pwd`" |
||||
cd "`dirname \"$PRG\"`/" >/dev/null |
||||
APP_HOME="`pwd -P`" |
||||
cd "$SAVED" >/dev/null |
||||
|
||||
APP_NAME="Gradle" |
||||
APP_BASE_NAME=`basename "$0"` |
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. |
||||
DEFAULT_JVM_OPTS="" |
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value. |
||||
MAX_FD="maximum" |
||||
|
||||
warn () { |
||||
echo "$*" |
||||
} |
||||
|
||||
die () { |
||||
echo |
||||
echo "$*" |
||||
echo |
||||
exit 1 |
||||
} |
||||
|
||||
# OS specific support (must be 'true' or 'false'). |
||||
cygwin=false |
||||
msys=false |
||||
darwin=false |
||||
nonstop=false |
||||
case "`uname`" in |
||||
CYGWIN* ) |
||||
cygwin=true |
||||
;; |
||||
Darwin* ) |
||||
darwin=true |
||||
;; |
||||
MINGW* ) |
||||
msys=true |
||||
;; |
||||
NONSTOP* ) |
||||
nonstop=true |
||||
;; |
||||
esac |
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar |
||||
|
||||
# Determine the Java command to use to start the JVM. |
||||
if [ -n "$JAVA_HOME" ] ; then |
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then |
||||
# IBM's JDK on AIX uses strange locations for the executables |
||||
JAVACMD="$JAVA_HOME/jre/sh/java" |
||||
else |
||||
JAVACMD="$JAVA_HOME/bin/java" |
||||
fi |
||||
if [ ! -x "$JAVACMD" ] ; then |
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME |
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the |
||||
location of your Java installation." |
||||
fi |
||||
else |
||||
JAVACMD="java" |
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. |
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the |
||||
location of your Java installation." |
||||
fi |
||||
|
||||
# Increase the maximum file descriptors if we can. |
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then |
||||
MAX_FD_LIMIT=`ulimit -H -n` |
||||
if [ $? -eq 0 ] ; then |
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then |
||||
MAX_FD="$MAX_FD_LIMIT" |
||||
fi |
||||
ulimit -n $MAX_FD |
||||
if [ $? -ne 0 ] ; then |
||||
warn "Could not set maximum file descriptor limit: $MAX_FD" |
||||
fi |
||||
else |
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" |
||||
fi |
||||
fi |
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock |
||||
if $darwin; then |
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" |
||||
fi |
||||
|
||||
# For Cygwin, switch paths to Windows format before running java |
||||
if $cygwin ; then |
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"` |
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` |
||||
JAVACMD=`cygpath --unix "$JAVACMD"` |
||||
|
||||
# We build the pattern for arguments to be converted via cygpath |
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` |
||||
SEP="" |
||||
for dir in $ROOTDIRSRAW ; do |
||||
ROOTDIRS="$ROOTDIRS$SEP$dir" |
||||
SEP="|" |
||||
done |
||||
OURCYGPATTERN="(^($ROOTDIRS))" |
||||
# Add a user-defined pattern to the cygpath arguments |
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then |
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" |
||||
fi |
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh |
||||
i=0 |
||||
for arg in "$@" ; do |
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` |
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option |
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition |
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` |
||||
else |
||||
eval `echo args$i`="\"$arg\"" |
||||
fi |
||||
i=$((i+1)) |
||||
done |
||||
case $i in |
||||
(0) set -- ;; |
||||
(1) set -- "$args0" ;; |
||||
(2) set -- "$args0" "$args1" ;; |
||||
(3) set -- "$args0" "$args1" "$args2" ;; |
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;; |
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; |
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; |
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; |
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; |
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; |
||||
esac |
||||
fi |
||||
|
||||
# Escape application args |
||||
save () { |
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done |
||||
echo " " |
||||
} |
||||
APP_ARGS=$(save "$@") |
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules |
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" |
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong |
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then |
||||
cd "$(dirname "$0")" |
||||
fi |
||||
|
||||
exec "$JAVACMD" "$@" |
@ -0,0 +1,84 @@ |
||||
@if "%DEBUG%" == "" @echo off |
||||
@rem ########################################################################## |
||||
@rem |
||||
@rem Gradle startup script for Windows |
||||
@rem |
||||
@rem ########################################################################## |
||||
|
||||
@rem Set local scope for the variables with windows NT shell |
||||
if "%OS%"=="Windows_NT" setlocal |
||||
|
||||
set DIRNAME=%~dp0 |
||||
if "%DIRNAME%" == "" set DIRNAME=. |
||||
set APP_BASE_NAME=%~n0 |
||||
set APP_HOME=%DIRNAME% |
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. |
||||
set DEFAULT_JVM_OPTS= |
||||
|
||||
@rem Find java.exe |
||||
if defined JAVA_HOME goto findJavaFromJavaHome |
||||
|
||||
set JAVA_EXE=java.exe |
||||
%JAVA_EXE% -version >NUL 2>&1 |
||||
if "%ERRORLEVEL%" == "0" goto init |
||||
|
||||
echo. |
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. |
||||
echo. |
||||
echo Please set the JAVA_HOME variable in your environment to match the |
||||
echo location of your Java installation. |
||||
|
||||
goto fail |
||||
|
||||
:findJavaFromJavaHome |
||||
set JAVA_HOME=%JAVA_HOME:"=% |
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe |
||||
|
||||
if exist "%JAVA_EXE%" goto init |
||||
|
||||
echo. |
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% |
||||
echo. |
||||
echo Please set the JAVA_HOME variable in your environment to match the |
||||
echo location of your Java installation. |
||||
|
||||
goto fail |
||||
|
||||
:init |
||||
@rem Get command-line arguments, handling Windows variants |
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args |
||||
|
||||
:win9xME_args |
||||
@rem Slurp the command line arguments. |
||||
set CMD_LINE_ARGS= |
||||
set _SKIP=2 |
||||
|
||||
:win9xME_args_slurp |
||||
if "x%~1" == "x" goto execute |
||||
|
||||
set CMD_LINE_ARGS=%* |
||||
|
||||
:execute |
||||
@rem Setup the command line |
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar |
||||
|
||||
@rem Execute Gradle |
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% |
||||
|
||||
:end |
||||
@rem End local scope for the variables with windows NT shell |
||||
if "%ERRORLEVEL%"=="0" goto mainEnd |
||||
|
||||
:fail |
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of |
||||
rem the _cmd.exe /c_ return code! |
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 |
||||
exit /b 1 |
||||
|
||||
:mainEnd |
||||
if "%OS%"=="Windows_NT" endlocal |
||||
|
||||
:omega |
@ -0,0 +1,51 @@ |
||||
apply plugin: 'kotlin-platform-js' |
||||
apply plugin: 'com.moowork.node' |
||||
|
||||
dependencies { |
||||
expectedBy project(':common') |
||||
compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version" |
||||
testCompile "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version" |
||||
} |
||||
|
||||
tasks.withType(compileKotlin2Js.getClass()) { |
||||
kotlinOptions { |
||||
moduleKind = "umd" |
||||
sourceMap = true |
||||
metaInfo = true |
||||
} |
||||
} |
||||
|
||||
task populateNodeModules(type: Copy, dependsOn: compileKotlin2Js) { |
||||
from compileKotlin2Js.destinationDir |
||||
into "${buildDir}/node_modules" |
||||
|
||||
afterEvaluate { |
||||
configurations.testCompile.each { |
||||
from zipTree(it.absolutePath).matching { |
||||
include '*.js' |
||||
include '*.js.map' |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
node { |
||||
version = "$node_version" |
||||
npmVersion = "$npm_version" |
||||
download = true |
||||
} |
||||
|
||||
task installDependencies(type: NpmTask) { |
||||
args = ['install', 'mocha', 'source-map-support'] |
||||
if (project.hasProperty("teamcity")) args += 'mocha-teamcity-reporter' |
||||
} |
||||
|
||||
task prepareMocha(dependsOn: [compileTestKotlin2Js, populateNodeModules, installDependencies]) |
||||
|
||||
task runMocha(type: NodeTask, dependsOn: prepareMocha) { |
||||
script = file('node_modules/mocha/bin/mocha') |
||||
args = [compileTestKotlin2Js.outputFile, '--require=source-map-support/register'] |
||||
if (project.hasProperty("teamcity")) args += '--reporter=mocha-teamcity-reporter' |
||||
} |
||||
|
||||
test.dependsOn runMocha |
@ -0,0 +1,207 @@ |
||||
{ |
||||
"name": "KotlinMultiplatformPlayground-js", |
||||
"requires": true, |
||||
"lockfileVersion": 1, |
||||
"dependencies": { |
||||
"balanced-match": { |
||||
"version": "1.0.0", |
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", |
||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", |
||||
"dev": true |
||||
}, |
||||
"brace-expansion": { |
||||
"version": "1.1.8", |
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", |
||||
"integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", |
||||
"dev": true, |
||||
"requires": { |
||||
"balanced-match": "1.0.0", |
||||
"concat-map": "0.0.1" |
||||
} |
||||
}, |
||||
"browser-stdout": { |
||||
"version": "1.3.0", |
||||
"resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", |
||||
"integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", |
||||
"dev": true |
||||
}, |
||||
"commander": { |
||||
"version": "2.11.0", |
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", |
||||
"integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", |
||||
"dev": true |
||||
}, |
||||
"concat-map": { |
||||
"version": "0.0.1", |
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", |
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", |
||||
"dev": true |
||||
}, |
||||
"debug": { |
||||
"version": "3.1.0", |
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", |
||||
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", |
||||
"dev": true, |
||||
"requires": { |
||||
"ms": "2.0.0" |
||||
} |
||||
}, |
||||
"diff": { |
||||
"version": "3.3.1", |
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", |
||||
"integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==", |
||||
"dev": true |
||||
}, |
||||
"escape-string-regexp": { |
||||
"version": "1.0.5", |
||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", |
||||
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", |
||||
"dev": true |
||||
}, |
||||
"fs.realpath": { |
||||
"version": "1.0.0", |
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", |
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", |
||||
"dev": true |
||||
}, |
||||
"glob": { |
||||
"version": "7.1.2", |
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", |
||||
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", |
||||
"dev": true, |
||||
"requires": { |
||||
"fs.realpath": "1.0.0", |
||||
"inflight": "1.0.6", |
||||
"inherits": "2.0.3", |
||||
"minimatch": "3.0.4", |
||||
"once": "1.4.0", |
||||
"path-is-absolute": "1.0.1" |
||||
} |
||||
}, |
||||
"growl": { |
||||
"version": "1.10.3", |
||||
"resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz", |
||||
"integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==", |
||||
"dev": true |
||||
}, |
||||
"has-flag": { |
||||
"version": "2.0.0", |
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", |
||||
"integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", |
||||
"dev": true |
||||
}, |
||||
"he": { |
||||
"version": "1.1.1", |
||||
"resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", |
||||
"integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", |
||||
"dev": true |
||||
}, |
||||
"inflight": { |
||||
"version": "1.0.6", |
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", |
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", |
||||
"dev": true, |
||||
"requires": { |
||||
"once": "1.4.0", |
||||
"wrappy": "1.0.2" |
||||
} |
||||
}, |
||||
"inherits": { |
||||
"version": "2.0.3", |
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", |
||||
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", |
||||
"dev": true |
||||
}, |
||||
"minimatch": { |
||||
"version": "3.0.4", |
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", |
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", |
||||
"dev": true, |
||||
"requires": { |
||||
"brace-expansion": "1.1.8" |
||||
} |
||||
}, |
||||
"minimist": { |
||||
"version": "0.0.8", |
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", |
||||
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", |
||||
"dev": true |
||||
}, |
||||
"mkdirp": { |
||||
"version": "0.5.1", |
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", |
||||
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", |
||||
"dev": true, |
||||
"requires": { |
||||
"minimist": "0.0.8" |
||||
} |
||||
}, |
||||
"mocha": { |
||||
"version": "4.1.0", |
||||
"resolved": "https://registry.npmjs.org/mocha/-/mocha-4.1.0.tgz", |
||||
"integrity": "sha512-0RVnjg1HJsXY2YFDoTNzcc1NKhYuXKRrBAG2gDygmJJA136Cs2QlRliZG1mA0ap7cuaT30mw16luAeln+4RiNA==", |
||||
"dev": true, |
||||
"requires": { |
||||
"browser-stdout": "1.3.0", |
||||
"commander": "2.11.0", |
||||
"debug": "3.1.0", |
||||
"diff": "3.3.1", |
||||
"escape-string-regexp": "1.0.5", |
||||
"glob": "7.1.2", |
||||
"growl": "1.10.3", |
||||
"he": "1.1.1", |
||||
"mkdirp": "0.5.1", |
||||
"supports-color": "4.4.0" |
||||
} |
||||
}, |
||||
"ms": { |
||||
"version": "2.0.0", |
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", |
||||
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", |
||||
"dev": true |
||||
}, |
||||
"once": { |
||||
"version": "1.4.0", |
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", |
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", |
||||
"dev": true, |
||||
"requires": { |
||||
"wrappy": "1.0.2" |
||||
} |
||||
}, |
||||
"path-is-absolute": { |
||||
"version": "1.0.1", |
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", |
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", |
||||
"dev": true |
||||
}, |
||||
"source-map": { |
||||
"version": "0.6.1", |
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", |
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" |
||||
}, |
||||
"source-map-support": { |
||||
"version": "0.5.2", |
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.2.tgz", |
||||
"integrity": "sha512-9zHceZbQwERaMK1MiFguvx1dL9GQPLXInr2D/wUxAsuV6ZKc9F0DHYWeloMcalkYRbtanwqUakoDjvj55cL/4A==", |
||||
"requires": { |
||||
"source-map": "0.6.1" |
||||
} |
||||
}, |
||||
"supports-color": { |
||||
"version": "4.4.0", |
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", |
||||
"integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", |
||||
"dev": true, |
||||
"requires": { |
||||
"has-flag": "2.0.0" |
||||
} |
||||
}, |
||||
"wrappy": { |
||||
"version": "1.0.2", |
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", |
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", |
||||
"dev": true |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,12 @@ |
||||
{ |
||||
"name": "KotlinMultiplatformPlayground-js", |
||||
"description": "KotlinMultiplatformPlayground-js", |
||||
"license": "Apache-2.0", |
||||
"repository": "http://github.com/elizarov/KotlinMultiplatformPlayground", |
||||
"devDependencies": { |
||||
"mocha": "^4.1.0" |
||||
}, |
||||
"dependencies": { |
||||
"source-map-support": "^0.5.2" |
||||
} |
||||
} |
@ -0,0 +1,4 @@ |
||||
|
||||
actual class Platform actual constructor() { |
||||
actual fun platform(): String = "platform-js" |
||||
} |
@ -0,0 +1,8 @@ |
||||
import kotlin.test.* |
||||
|
||||
class ActualPlatformTest { |
||||
@Test |
||||
fun testPlatform() { |
||||
assertEquals("platform-js", Platform().platform()) |
||||
} |
||||
} |
@ -0,0 +1,15 @@ |
||||
apply plugin: 'kotlin-platform-jvm' |
||||
|
||||
dependencies { |
||||
expectedBy project(':common') |
||||
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" |
||||
testCompile "junit:junit:4.12" |
||||
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" |
||||
testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" |
||||
} |
||||
|
||||
tasks.withType(compileKotlin.getClass()) { |
||||
kotlinOptions { |
||||
jvmTarget = "1.8" |
||||
} |
||||
} |
@ -0,0 +1,4 @@ |
||||
|
||||
actual class Platform actual constructor() { |
||||
actual fun platform(): String = "platform-jvm" |
||||
} |
@ -0,0 +1,8 @@ |
||||
import kotlin.test.* |
||||
|
||||
class ActualPlatformTest { |
||||
@Test |
||||
fun testPlatform() { |
||||
assertEquals("platform-jvm", Platform().platform()) |
||||
} |
||||
} |
@ -0,0 +1,5 @@ |
||||
rootProject.name = 'KotlinMultiplatformPlayground' |
||||
|
||||
include 'common' |
||||
include 'jvm' |
||||
include 'js' |
Loading…
Reference in new issue