##// END OF EJS Templates
wip migrating on new typescript build plugin
cin -
r174:b00d3153045c default
parent child
Show More
@@ -16,12 +16,12
16 16 </natures>
17 17 <filteredResources>
18 18 <filter>
19 <id>1599549685358</id>
19 <id>1678653378261</id>
20 20 <name></name>
21 21 <type>30</type>
22 22 <matcher>
23 23 <id>org.eclipse.core.resources.regexFilterMatcher</id>
24 <arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
24 <arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
25 25 </matcher>
26 26 </filter>
27 27 </filteredResources>
@@ -1,11 +1,11
1 arguments=
1 arguments=--init-script /home/sergey/.config/Code/User/globalStorage/redhat.java/1.21.0/config_linux/org.eclipse.osgi/51/0/.cp/gradle/init/init.gradle --init-script /home/sergey/.config/Code/User/globalStorage/redhat.java/1.21.0/config_linux/org.eclipse.osgi/51/0/.cp/gradle/protobuf/init.gradle
2 2 auto.sync=false
3 3 build.scans.enabled=false
4 4 connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
5 5 connection.project.dir=
6 6 eclipse.preferences.version=1
7 7 gradle.user.home=
8 java.home=/usr/lib64/jvm/java
8 java.home=/usr/lib64/jvm/java-11-openjdk-11
9 9 jvm.arguments=
10 10 offline.mode=false
11 11 override.workspace.settings=true
@@ -1,224 +1,97
1 1 plugins {
2 id "org.implab.gradle-typescript" version "1.3.3"
3 id "org.implab.gradle-hg"
4 id "ivy-publish"
5 }
6
7 if (!symbols in ['local', 'pack', 'none'])
8 throw new Exception("The symbols property value is invalid: $symbols");
9
10 if (!flavour in ['browser', 'node'])
11 throw new Exception("The flavour property value is invalid: $flavour");
12
13 ext {
14 packageName = flavour == 'browser' ? "@$npmScope/$name-amd" : "@$npmScope/$name"
15 lint = project.hasProperty('lint') ? project.lint ?: true : false
2 id "org.implab.gradle-typescript"
3 id "org.implab.gradle-npm-package"
4 id "ivy-publish"
16 5 }
17 6
18 sources {
19 amd {
20 typings {
21 srcDir main.output.typingsDir
22 }
23 }
24
25 cjs {
26 typings {
27 srcDir main.output.typingsDir
28 }
29 }
7 typescript {
8 useTsc npm.bin("tsc")
30 9
31 testAmd {
32 typings {
33 srcDir main.output.typingsDir
34 srcDir amd.output.typingsDir
35 srcDir test.output.typingsDir
36 }
37 }
38
39 testCjs {
40 typings {
41 srcDir main.output.typingsDir
42 srcDir cjs.output.typingsDir
43 srcDir test.output.typingsDir
44 }
10 compilerOptions {
11 incremental = true
45 12 }
46 13 }
47 14
48 typescript {
49 compilerOptions {
50 types = []
51 declaration = true
52 experimentalDecorators = true
53 strict = true
54 // dojo-typings are sick
55 skipLibCheck = true
56
57 if(symbols != 'none') {
58 sourceMap = true
59 sourceRoot = "pack:${packageName}"
60 }
61
62 if (flavour == 'node') {
63 module = "commonjs"
64 target = "es2017"
65 lib = ["es2017", "dom", "scripthost"]
66 } else if (flavour == 'browser') {
67 module = "amd"
68 target = "es5"
69 lib = ["es5", "dom", "scripthost", "es2015.promise", "es2015.symbol", "es2015.iterable" ]
70 }
71 }
72 tscCmd = "$projectDir/node_modules/.bin/tsc"
73 tsLintCmd = "$projectDir/node_modules/.bin/tslint"
74 esLintCmd = "$projectDir/node_modules/.bin/eslint"
75 }
76
77 tasks.matching{ it.name =~ /^lint/ }.configureEach {
78 onlyIf { lint }
79 }
80
81 if (symbols == 'local') {
82 tasks.matching{ it.name =~ /^configureTs/ }.configureEach {
83 compilerOptions {
84 sourceRoot = "file://" + it.rootDir
15 def typingsFromMain = {
16 sets {
17 named("compileOnlyTypings") {
18 srcDir main.output("typings")
85 19 }
86 20 }
87 21 }
88 22
89 task printVersion {
90 doLast {
91 println "packageName: $packageName";
92 println "version: $version";
93 println "flavour: $flavour";
94 println "target: $typescript.compilerOptions.target";
95 println "module: $typescript.compilerOptions.module";
96 println "lint: $lint";
97 println "symbols: $symbols";
98 }
99 }
23 variants {
24 configureEach { variant ->
25 def sourceSetLocation = { setName, self ->
26 self.sourceSetDir = layout.projectDirectory.dir("src/${setName}")
27 self.outputsDir = layout.buildDirectory.dir("${variant.name}/${setName}")
28 }
100 29
101 npmPackMeta {
102 meta {
103 name = packageName
104 }
105 }
30 def main = sources.register("${variant.name}Main", sourceSetLocation.curry("main"))
31 def test = sources.register("${variant.name}Test", sourceSetLocation.curry("test"))
106 32
107 configureTsCjs {
108 dependsOn sources.main.output
109 compilerOptions {
110 types += [ "node" ]
33 sourceSets {
34 add(main) {
35 role "main"
36 }
37 add(test) {
38 role "test"
39 }
40 }
111 41 }
112 }
42 register("browser") {
43 def srcAmd = sources.register("amd", typingsFromMain)
44 def srcTestAmd = sources.register("testAmd", typingsFromMain)
45
46 // advice to all TypescriptCompile tasks
47 typescriptCompile {
48 baseTsConfig = file("src/tsconfig.browser.json")
49 }
113 50
114 configureTsAmd {
115 dependsOn sources.main.output
116 compilerOptions {
117 types += [ "requirejs", "dojo-typings" ]
118 }
119 }
51 // creates npmPackBrowser, npmPublishBrowser
52 npmPackage {
53 usePackageJson()
54 metadata {
55 name = "@implab/core-amd"
56 }
57 content {
58 from sourceSets.byRoles("main").allOutputs()
59 }
60 }
120 61
121 test {
122 workingDir layout.buildDirectory.dir("test");
123 commandLine "node", "tests/index.js"
124 }
62 sourceSets {
63 add(srcAmd) {
64 role "main"
65 }
66 add(srcTestAmd) {
67 role "test"
68 }
69 }
70 }
71 register("node") {
72 def srcCjs = sources.register("cjs", typingsFromMain)
73 def srcTestCjs = sources.register("testCjs", typingsFromMain)
125 74
126 assemble {
127 if (flavour == 'browser') {
128 dependsOn sources.amd.output
129 from sources.amd.output.compiledDir
130 from sources.amd.resources
131 }
132 if (flavour == 'node') {
133 dependsOn sources.cjs.output
134 from sources.cjs.output.compiledDir
135 from sources.cjs.resources
136 }
75 compileTasks {
76 baseTsConfig = file("src/tsconfig.node.json")
77 }
78
79 npmPackage {
80 name = "@implab/core"
81 }
82
83 sourceSets {
84 add srcAmd
85 add srcTestAmd
86 }
137 87 }
138 88
139 assembleTest {
140 if (flavour == 'browser') {
141 dependsOn sources.amd.output, sources.testAmd.output
142
143 from sources.amd.output.compiledDir
144 from sources.testAmd.output.compiledDir
145 from sources.amd.resources
146 from sources.testAmd.resources
147 }
148 if (flavour == 'node') {
149 dependsOn sources.cjs.output, sources.testCjs.output
150
151 from sources.cjs.output.compiledDir
152 from sources.testCjs.output.compiledDir
153 from sources.cjs.resources
154 from sources.testCjs.resources
155 }
156 }
157
158 typings {
159 if (flavour == 'browser') {
160 dependsOn sources.amd.output
161 from sources.amd.output.typingsDir
162 }
163 if (flavour == 'node') {
164 dependsOn sources.cjs.output
165 from sources.cjs.output.typingsDir
166 }
167 }
168
169 task npmPackTypings(type: Copy) {
170 npmPackContents.dependsOn it
171 dependsOn sources.main.output
172
173 from sources.main.output.typingsDir
174
175 if (flavour == 'browser') {
176 dependsOn sources.amd.output
177 from sources.amd.output.typingsDir
89 npmPackage {
90 usePackageJson()
91 metadata {
92 name = "@implab/core"
93 version = project.provider { project.version.toString() }
178 94 }
179 if (flavour == 'node') {
180 dependsOn sources.cjs.output
181 from sources.cjs.output.typingsDir
182 }
183
184 into npm.packageDir
185 }
186
187 task npmPackSources(type: Copy) {
188 from sources.main.ts
189 if (symbols == 'pack') {
190 npmPackContents.dependsOn npmPackSources
191 }
192
193 if (flavour == 'browser') {
194 from sources.amd.ts
195 }
196 if (flavour == 'node') {
197 from sources.cjs.ts
198 }
199
200 into npm.packageDir.dir("_src")
201 }
202
203
204
205 task packJsTar(type: Tar) {
206 dependsOn assemble;
207
208 archiveBaseName = provider { packageName }
209
210 destinationDirectory = buildDir
211 archiveClassifier = provider { typescript.compilerOptions.module }
212 compression = Compression.GZIP
213
214 from(assemble.outputs)
215
216 doLast {
217 println archiveName;
218 }
219 }
220
221 task packTypingsTar(type: Tar) {
222 95 }
223 96
224 97 publishing {
@@ -1,9 +1,6
1 1 group=org.implab
2 2 version=
3 author=Implab team
4 description=Dependency injection, logging, simple and fast text processing tools
5 license=BSD-2-Clause
6 repository=https://bitbucket.org/implab/implabjs-core
7 npmScope=implab
8 flavour=browser
9 symbols=pack No newline at end of file
3
4 org.gradle.parallel=true
5 org.gradle.configuration-cache.parallel=true
6 org.gradle.configuration-cache=true No newline at end of file
1 NO CONTENT: modified file, binary diff hidden
@@ -1,5 +1,7
1 1 distributionBase=GRADLE_USER_HOME
2 2 distributionPath=wrapper/dists
3 distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-bin.zip
3 distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
4 networkTimeout=10000
5 validateDistributionUrl=true
4 6 zipStoreBase=GRADLE_USER_HOME
5 7 zipStorePath=wrapper/dists
@@ -1,7 +1,7
1 #!/usr/bin/env sh
1 #!/bin/sh
2 2
3 3 #
4 # Copyright 2015 the original author or authors.
4 # Copyright © 2015 the original authors.
5 5 #
6 6 # Licensed under the Apache License, Version 2.0 (the "License");
7 7 # you may not use this file except in compliance with the License.
@@ -15,80 +15,114
15 15 # See the License for the specific language governing permissions and
16 16 # limitations under the License.
17 17 #
18 # SPDX-License-Identifier: Apache-2.0
19 #
18 20
19 21 ##############################################################################
20 ##
21 ## Gradle start up script for UN*X
22 ##
22 #
23 # Gradle start up script for POSIX generated by Gradle.
24 #
25 # Important for running:
26 #
27 # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
28 # noncompliant, but you have some other compliant shell such as ksh or
29 # bash, then to run this script, type that shell name before the whole
30 # command line, like:
31 #
32 # ksh Gradle
33 #
34 # Busybox and similar reduced shells will NOT work, because this script
35 # requires all of these POSIX shell features:
36 # * functions;
37 # * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
38 # «${var#prefix}», «${var%suffix}», and «$( cmd )»;
39 # * compound commands having a testable exit status, especially «case»;
40 # * various built-in commands including «command», «set», and «ulimit».
41 #
42 # Important for patching:
43 #
44 # (2) This script targets any POSIX shell, so it avoids extensions provided
45 # by Bash, Ksh, etc; in particular arrays are avoided.
46 #
47 # The "traditional" practice of packing multiple parameters into a
48 # space-separated string is a well documented source of bugs and security
49 # problems, so this is (mostly) avoided, by progressively accumulating
50 # options in "$@", and eventually passing that to Java.
51 #
52 # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
53 # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
54 # see the in-line comments for details.
55 #
56 # There are tweaks for specific operating systems such as AIX, CygWin,
57 # Darwin, MinGW, and NonStop.
58 #
59 # (3) This script is generated from the Groovy template
60 # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
61 # within the Gradle project.
62 #
63 # You can find Gradle at https://github.com/gradle/gradle/.
64 #
23 65 ##############################################################################
24 66
25 67 # Attempt to set APP_HOME
68
26 69 # Resolve links: $0 may be a link
27 PRG="$0"
28 # Need this for relative symlinks.
29 while [ -h "$PRG" ] ; do
30 ls=`ls -ld "$PRG"`
31 link=`expr "$ls" : '.*-> \(.*\)$'`
32 if expr "$link" : '/.*' > /dev/null; then
33 PRG="$link"
34 else
35 PRG=`dirname "$PRG"`"/$link"
36 fi
70 app_path=$0
71
72 # Need this for daisy-chained symlinks.
73 while
74 APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
75 [ -h "$app_path" ]
76 do
77 ls=$( ls -ld "$app_path" )
78 link=${ls#*' -> '}
79 case $link in #(
80 /*) app_path=$link ;; #(
81 *) app_path=$APP_HOME$link ;;
82 esac
37 83 done
38 SAVED="`pwd`"
39 cd "`dirname \"$PRG\"`/" >/dev/null
40 APP_HOME="`pwd -P`"
41 cd "$SAVED" >/dev/null
42 84
43 APP_NAME="Gradle"
44 APP_BASE_NAME=`basename "$0"`
45
46 # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
85 # This is normally unused
86 # shellcheck disable=SC2034
87 APP_BASE_NAME=${0##*/}
88 # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
89 APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
48 90
49 91 # Use the maximum available, or set MAX_FD != -1 to use that value.
50 MAX_FD="maximum"
92 MAX_FD=maximum
51 93
52 94 warn () {
53 95 echo "$*"
54 }
96 } >&2
55 97
56 98 die () {
57 99 echo
58 100 echo "$*"
59 101 echo
60 102 exit 1
61 }
103 } >&2
62 104
63 105 # OS specific support (must be 'true' or 'false').
64 106 cygwin=false
65 107 msys=false
66 108 darwin=false
67 109 nonstop=false
68 case "`uname`" in
69 CYGWIN* )
70 cygwin=true
71 ;;
72 Darwin* )
73 darwin=true
74 ;;
75 MINGW* )
76 msys=true
77 ;;
78 NONSTOP* )
79 nonstop=true
80 ;;
110 case "$( uname )" in #(
111 CYGWIN* ) cygwin=true ;; #(
112 Darwin* ) darwin=true ;; #(
113 MSYS* | MINGW* ) msys=true ;; #(
114 NONSTOP* ) nonstop=true ;;
81 115 esac
82 116
83 CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
117
84 118
85 119 # Determine the Java command to use to start the JVM.
86 120 if [ -n "$JAVA_HOME" ] ; then
87 121 if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
88 122 # IBM's JDK on AIX uses strange locations for the executables
89 JAVACMD="$JAVA_HOME/jre/sh/java"
123 JAVACMD=$JAVA_HOME/jre/sh/java
90 124 else
91 JAVACMD="$JAVA_HOME/bin/java"
125 JAVACMD=$JAVA_HOME/bin/java
92 126 fi
93 127 if [ ! -x "$JAVACMD" ] ; then
94 128 die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -97,92 +131,118 Please set the JAVA_HOME variable in you
97 131 location of your Java installation."
98 132 fi
99 133 else
100 JAVACMD="java"
101 which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
134 JAVACMD=java
135 if ! command -v java >/dev/null 2>&1
136 then
137 die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
102 138
103 139 Please set the JAVA_HOME variable in your environment to match the
104 140 location of your Java installation."
105 fi
106
107 # Increase the maximum file descriptors if we can.
108 if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
109 MAX_FD_LIMIT=`ulimit -H -n`
110 if [ $? -eq 0 ] ; then
111 if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
112 MAX_FD="$MAX_FD_LIMIT"
113 fi
114 ulimit -n $MAX_FD
115 if [ $? -ne 0 ] ; then
116 warn "Could not set maximum file descriptor limit: $MAX_FD"
117 fi
118 else
119 warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
120 141 fi
121 142 fi
122 143
123 # For Darwin, add options to specify how the application appears in the dock
124 if $darwin; then
125 GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
126 fi
127
128 # For Cygwin or MSYS, switch paths to Windows format before running java
129 if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
130 APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131 CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
132 JAVACMD=`cygpath --unix "$JAVACMD"`
133
134 # We build the pattern for arguments to be converted via cygpath
135 ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
136 SEP=""
137 for dir in $ROOTDIRSRAW ; do
138 ROOTDIRS="$ROOTDIRS$SEP$dir"
139 SEP="|"
140 done
141 OURCYGPATTERN="(^($ROOTDIRS))"
142 # Add a user-defined pattern to the cygpath arguments
143 if [ "$GRADLE_CYGPATTERN" != "" ] ; then
144 OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
145 fi
146 # Now convert the arguments - kludge to limit ourselves to /bin/sh
147 i=0
148 for arg in "$@" ; do
149 CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
150 CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
151
152 if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
153 eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
154 else
155 eval `echo args$i`="\"$arg\""
156 fi
157 i=$((i+1))
158 done
159 case $i in
160 (0) set -- ;;
161 (1) set -- "$args0" ;;
162 (2) set -- "$args0" "$args1" ;;
163 (3) set -- "$args0" "$args1" "$args2" ;;
164 (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165 (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166 (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167 (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168 (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169 (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
144 # Increase the maximum file descriptors if we can.
145 if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
146 case $MAX_FD in #(
147 max*)
148 # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
149 # shellcheck disable=SC2039,SC3045
150 MAX_FD=$( ulimit -H -n ) ||
151 warn "Could not query maximum file descriptor limit"
152 esac
153 case $MAX_FD in #(
154 '' | soft) :;; #(
155 *)
156 # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
157 # shellcheck disable=SC2039,SC3045
158 ulimit -n "$MAX_FD" ||
159 warn "Could not set maximum file descriptor limit to $MAX_FD"
170 160 esac
171 161 fi
172 162
173 # Escape application args
174 save () {
175 for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176 echo " "
177 }
178 APP_ARGS=$(save "$@")
163 # Collect all arguments for the java command, stacking in reverse order:
164 # * args from the command line
165 # * the main class name
166 # * -classpath
167 # * -D...appname settings
168 # * --module-path (only if needed)
169 # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
170
171 # For Cygwin or MSYS, switch paths to Windows format before running java
172 if "$cygwin" || "$msys" ; then
173 APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
174
175 JAVACMD=$( cygpath --unix "$JAVACMD" )
179 176
180 # Collect all arguments for the java command, following the shell quoting and substitution rules
181 eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182
183 # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
184 if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
185 cd "$(dirname "$0")"
177 # Now convert the arguments - kludge to limit ourselves to /bin/sh
178 for arg do
179 if
180 case $arg in #(
181 -*) false ;; # don't mess with options #(
182 /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
183 [ -e "$t" ] ;; #(
184 *) false ;;
185 esac
186 then
187 arg=$( cygpath --path --ignore --mixed "$arg" )
188 fi
189 # Roll the args list around exactly as many times as the number of
190 # args, so each arg winds up back in the position where it started, but
191 # possibly modified.
192 #
193 # NB: a `for` loop captures its iteration list before it begins, so
194 # changing the positional parameters here affects neither the number of
195 # iterations, nor the values presented in `arg`.
196 shift # remove old arg
197 set -- "$@" "$arg" # push replacement arg
198 done
186 199 fi
187 200
201
202 # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
203 DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204
205 # Collect all arguments for the java command:
206 # * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207 # and any embedded shellness will be escaped.
208 # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209 # treated as '${Hostname}' itself on the command line.
210
211 set -- \
212 "-Dorg.gradle.appname=$APP_BASE_NAME" \
213 -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
214 "$@"
215
216 # Stop when "xargs" is not available.
217 if ! command -v xargs >/dev/null 2>&1
218 then
219 die "xargs is not available"
220 fi
221
222 # Use "xargs" to parse quoted args.
223 #
224 # With -n1 it outputs one arg per line, with the quotes and backslashes removed.
225 #
226 # In Bash we could simply go:
227 #
228 # readarray ARGS < <( xargs -n1 <<<"$var" ) &&
229 # set -- "${ARGS[@]}" "$@"
230 #
231 # but POSIX shell has neither arrays nor command substitution, so instead we
232 # post-process each arg (as a line of input to sed) to backslash-escape any
233 # character that might be a shell metacharacter, then use eval to reverse
234 # that process (while maintaining the separation between arguments), and wrap
235 # the whole thing up as a single "set" statement.
236 #
237 # This will of course break if any of these variables contains a newline or
238 # an unmatched quote.
239 #
240
241 eval "set -- $(
242 printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
243 xargs -n1 |
244 sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
245 tr '\n' ' '
246 )" '"$@"'
247
188 248 exec "$JAVACMD" "$@"
@@ -13,8 +13,10
13 13 @rem See the License for the specific language governing permissions and
14 14 @rem limitations under the License.
15 15 @rem
16 @rem SPDX-License-Identifier: Apache-2.0
17 @rem
16 18
17 @if "%DEBUG%" == "" @echo off
19 @if "%DEBUG%"=="" @echo off
18 20 @rem ##########################################################################
19 21 @rem
20 22 @rem Gradle startup script for Windows
@@ -25,10 +27,14
25 27 if "%OS%"=="Windows_NT" setlocal
26 28
27 29 set DIRNAME=%~dp0
28 if "%DIRNAME%" == "" set DIRNAME=.
30 if "%DIRNAME%"=="" set DIRNAME=.
31 @rem This is normally unused
29 32 set APP_BASE_NAME=%~n0
30 33 set APP_HOME=%DIRNAME%
31 34
35 @rem Resolve any "." and ".." in APP_HOME to make it shorter.
36 for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
37
32 38 @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
33 39 set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
34 40
@@ -37,13 +43,13 if defined JAVA_HOME goto findJavaFromJa
37 43
38 44 set JAVA_EXE=java.exe
39 45 %JAVA_EXE% -version >NUL 2>&1
40 if "%ERRORLEVEL%" == "0" goto init
46 if %ERRORLEVEL% equ 0 goto execute
41 47
42 echo.
43 echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
44 echo.
45 echo Please set the JAVA_HOME variable in your environment to match the
46 echo location of your Java installation.
48 echo. 1>&2
49 echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50 echo. 1>&2
51 echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52 echo location of your Java installation. 1>&2
47 53
48 54 goto fail
49 55
@@ -51,48 +57,35 goto fail
51 57 set JAVA_HOME=%JAVA_HOME:"=%
52 58 set JAVA_EXE=%JAVA_HOME%/bin/java.exe
53 59
54 if exist "%JAVA_EXE%" goto init
60 if exist "%JAVA_EXE%" goto execute
55 61
56 echo.
57 echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
58 echo.
59 echo Please set the JAVA_HOME variable in your environment to match the
60 echo location of your Java installation.
62 echo. 1>&2
63 echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64 echo. 1>&2
65 echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66 echo location of your Java installation. 1>&2
61 67
62 68 goto fail
63 69
64 :init
65 @rem Get command-line arguments, handling Windows variants
66
67 if not "%OS%" == "Windows_NT" goto win9xME_args
68
69 :win9xME_args
70 @rem Slurp the command line arguments.
71 set CMD_LINE_ARGS=
72 set _SKIP=2
73
74 :win9xME_args_slurp
75 if "x%~1" == "x" goto execute
76
77 set CMD_LINE_ARGS=%*
78
79 70 :execute
80 71 @rem Setup the command line
81 72
82 set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73
83 74
84 75 @rem Execute Gradle
85 "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
86 77
87 78 :end
88 79 @rem End local scope for the variables with windows NT shell
89 if "%ERRORLEVEL%"=="0" goto mainEnd
80 if %ERRORLEVEL% equ 0 goto mainEnd
90 81
91 82 :fail
92 83 rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
93 84 rem the _cmd.exe /c_ return code!
94 if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
95 exit /b 1
85 set EXIT_CODE=%ERRORLEVEL%
86 if %EXIT_CODE% equ 0 set EXIT_CODE=1
87 if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
88 exit /b %EXIT_CODE%
96 89
97 90 :mainEnd
98 91 if "%OS%"=="Windows_NT" endlocal
@@ -4,10 +4,9
4 4 "types": [
5 5 "node"
6 6 ],
7 "rootDir": "ts",
8 7 "rootDirs": [
9 8 "ts",
10 "../typings/main"
9 "../main/ts"
11 10 ]
12 11 },
13 12 "include": [
@@ -100,8 +100,7 export interface IActivatable {
100 100 * @param controller The activation controller
101 101 *
102 102 * Activation controller checks whether this component
103 * can be activated and manages the active state of the
104 * component
103 * can be activated and manages the active state of it.
105 104 */
106 105 setActivationController(controller: IActivationController): void;
107 106
General Comments 0
You need to be logged in to leave comments. Login now