2
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								pom.xml
									
									
									
									
									
								
							@@ -2,7 +2,7 @@
 | 
				
			|||||||
    <modelVersion>4.0.0</modelVersion>
 | 
					    <modelVersion>4.0.0</modelVersion>
 | 
				
			||||||
    <groupId>pw.yumc</groupId>
 | 
					    <groupId>pw.yumc</groupId>
 | 
				
			||||||
    <artifactId>MiaoScript</artifactId>
 | 
					    <artifactId>MiaoScript</artifactId>
 | 
				
			||||||
    <version>0.11.0</version>
 | 
					    <version>0.11.1</version>
 | 
				
			||||||
    <developers>
 | 
					    <developers>
 | 
				
			||||||
        <developer>
 | 
					        <developer>
 | 
				
			||||||
            <id>502647092</id>
 | 
					            <id>502647092</id>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -57,12 +57,12 @@ var global = this;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    global.start = function (future) {
 | 
					    global.start = function (future) {
 | 
				
			||||||
        if (!future.isDone()) {
 | 
					        if (!future.isDone()) {
 | 
				
			||||||
            logger.info("Waiting MiaoScript booted...")
 | 
					            log.info("Waiting MiaoScript booted...")
 | 
				
			||||||
            future.get()
 | 
					            future.get()
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        logger.info("MiaoScript booted starting...")
 | 
					        log.info("MiaoScript booted starting...")
 | 
				
			||||||
        global.engineDisableImpl = require(java.lang.System.getenv("MS_NODE_CORE_MODULE") || (global.scope + '/core')).default || function () {
 | 
					        global.engineDisableImpl = require(java.lang.System.getenv("MS_NODE_CORE_MODULE") || (global.scope + '/core')).default || function () {
 | 
				
			||||||
            logger.info('Error: abnormal Initialization MiaoScript Engine. Skip disable step...')
 | 
					            log.info('Error: abnormal Initialization MiaoScript Engine. Skip disable step...')
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -52,6 +52,10 @@
 | 
				
			|||||||
        // @ts-ignore
 | 
					        // @ts-ignore
 | 
				
			||||||
        var URL = Java.type('java.net.URL')
 | 
					        var URL = Java.type('java.net.URL')
 | 
				
			||||||
        // @ts-ignore
 | 
					        // @ts-ignore
 | 
				
			||||||
 | 
					        var Thread = Java.type('java.net.URL')
 | 
				
			||||||
 | 
					        // @ts-ignore
 | 
				
			||||||
 | 
					        var FutureTask = Java.type('java.util.concurrent.FutureTask')
 | 
				
			||||||
 | 
					        // @ts-ignore
 | 
				
			||||||
        var JavaString = Java.type('java.lang.String')
 | 
					        var JavaString = Java.type('java.lang.String')
 | 
				
			||||||
        var separatorChar = File.separatorChar
 | 
					        var separatorChar = File.separatorChar
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -301,6 +305,7 @@
 | 
				
			|||||||
            var info = fetchPackageInfo(module_name)
 | 
					            var info = fetchPackageInfo(module_name)
 | 
				
			||||||
            var url = info.versions[ModulesVersionLock[module_name] || info['dist-tags']['latest']].dist.tarball
 | 
					            var url = info.versions[ModulesVersionLock[module_name] || info['dist-tags']['latest']].dist.tarball
 | 
				
			||||||
            console.log('fetch node_module ' + module_name + ' from ' + url + ' waiting...')
 | 
					            console.log('fetch node_module ' + module_name + ' from ' + url + ' waiting...')
 | 
				
			||||||
 | 
					            var future = new FutureTask(function () {
 | 
				
			||||||
                var tis = new TarInputStream(new BufferedInputStream(new GZIPInputStream(new URL(url).openStream())))
 | 
					                var tis = new TarInputStream(new BufferedInputStream(new GZIPInputStream(new URL(url).openStream())))
 | 
				
			||||||
                // @ts-ignore
 | 
					                // @ts-ignore
 | 
				
			||||||
                var entry
 | 
					                var entry
 | 
				
			||||||
@@ -310,6 +315,9 @@
 | 
				
			|||||||
                    Files.copy(tis, targetPath, StandardCopyOption.REPLACE_EXISTING)
 | 
					                    Files.copy(tis, targetPath, StandardCopyOption.REPLACE_EXISTING)
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                return name
 | 
					                return name
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
 | 
					            new Thread(future, "MiaoScript download thread").start()
 | 
				
			||||||
 | 
					            return future.get()
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /**
 | 
					        /**
 | 
				
			||||||
@@ -327,10 +335,14 @@
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        function fetchContent(url, name) {
 | 
					        function fetchContent(url, name) {
 | 
				
			||||||
 | 
					            var future = new FutureTask(function () {
 | 
				
			||||||
                var tempFile = Files.createTempFile(name.replace('/', '_'), '.json')
 | 
					                var tempFile = Files.createTempFile(name.replace('/', '_'), '.json')
 | 
				
			||||||
                Files.copy(new URL(url).openStream(), tempFile, StandardCopyOption.REPLACE_EXISTING)
 | 
					                Files.copy(new URL(url).openStream(), tempFile, StandardCopyOption.REPLACE_EXISTING)
 | 
				
			||||||
                tempFile.toFile().deleteOnExit()
 | 
					                tempFile.toFile().deleteOnExit()
 | 
				
			||||||
                return new JavaString(Files.readAllBytes(tempFile), 'UTF-8')
 | 
					                return new JavaString(Files.readAllBytes(tempFile), 'UTF-8')
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
 | 
					            new Thread(future, "MiaoScript require thread").start()
 | 
				
			||||||
 | 
					            return future.get()
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        var lastModule = ''
 | 
					        var lastModule = ''
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user