@@ -4041,14 +4041,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
40414041const exec = __importStar ( __webpack_require__ ( 230 ) ) ;
40424042const io = __importStar ( __webpack_require__ ( 954 ) ) ;
40434043const tc = __importStar ( __webpack_require__ ( 602 ) ) ;
4044+ const IS_WINDOWS = process . platform === 'win32' ;
40444045function instrument ( agentVersion ) {
40454046 return __awaiter ( this , void 0 , void 0 , function * ( ) {
4046- const workdir = process . cwd ( ) ;
4047- const scopeAgentPath = yield tc . downloadTool ( "https://repo1.maven.org/maven2/com/undefinedlabs/scope/scope-agent/" + agentVersion + "/scope-agent-" + agentVersion + ".jar" ) ;
4047+ let scopeAgentPath = yield tc . downloadTool ( "https://repo1.maven.org/maven2/com/undefinedlabs/scope/scope-agent/" + agentVersion + "/scope-agent-" + agentVersion + ".jar" ) ;
40484048 if ( ! scopeAgentPath . endsWith ( ".jar" ) ) {
40494049 yield io . mv ( scopeAgentPath , scopeAgentPath + ".jar" ) ;
40504050 }
4051- yield exec . exec ( "sh -c \"docker run -v " + workdir + ":/home/project -e \\\"SCOPE_AGENT_PATH=" + scopeAgentPath + ".jar\\\" codescope/scope-instrumentation-for-maven\"" ) ;
4051+ let mavenInstrumentatorPath = yield tc . downloadTool ( "https://repo1.maven.org/maven2/com/undefinedlabs/scope/scope-instrumentation-for-maven/0.1.0/scope-instrumentation-for-maven-0.1.0.jar" ) ;
4052+ if ( ! mavenInstrumentatorPath . endsWith ( ".jar" ) ) {
4053+ yield io . mv ( mavenInstrumentatorPath , mavenInstrumentatorPath + ".jar" ) ;
4054+ }
4055+ if ( IS_WINDOWS ) {
4056+ scopeAgentPath = scopeAgentPath . replace ( "\\" , "\\\\" ) ;
4057+ mavenInstrumentatorPath = mavenInstrumentatorPath . replace ( "\\" , "\\\\" ) ;
4058+ }
4059+ yield exec . exec ( "sh -c \"find . -name \\\"pom.xml\\\" -exec java -jar " + mavenInstrumentatorPath + ".jar \\\"" + scopeAgentPath + ".jar\\\" {} \\;\"" ) ;
40524060 } ) ;
40534061}
40544062exports . instrument = instrument ;
0 commit comments