Skip to content

Commit 3358f0a

Browse files
committed
KJS: use korlinc-js runner written in js to make possible to run it on any OS
Restore executable attributes on kotlinc* bash scripts after copying them.
1 parent 502ac80 commit 3358f0a

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env node
2+
/*
3+
* Copyright 2010-2017 JetBrains s.r.o.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
var spawn = require('child_process').spawn;
19+
20+
var execPath = __dirname + '/kotlinc-js';
21+
var args = process.argv.slice(2);
22+
23+
spawn('"' + execPath + '"', args, { stdio: "inherit", shell: true });

js/npm.templates/kotlin-compiler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"homepage": "kotlinlang.org",
2222
"bin": {
23-
"kotlinc-js": "bin/kotlinc-js"
23+
"kotlinc-js": "bin/kotlinc-js-runner.js"
2424
},
2525
"publishConfig" : {
2626
"tag" : "dev"

node_utils.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@
117117
<copy todir="${package_deploy_dir}" failonerror="true" >
118118
<fileset dir="${output}/kotlinc" />
119119
</copy>
120+
<chmod perm="ugo+rx">
121+
<fileset dir="${package_deploy_dir}/bin/">
122+
<include name="kotlinc"/>
123+
<include name="kotlinc-js"/>
124+
<include name="kotlinc-jvm"/>
125+
</fileset>
126+
</chmod>
120127
</publish-to-npm>
121128
</target>
122129

0 commit comments

Comments
 (0)