File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
packages/core/src/codewhisperer Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,14 @@ async function setBuildSystemCommand() {
108108 transformByQState . getBuildSystem ( ) === BuildSystem . Maven ? 'mvn' : 'gradle'
109109 )
110110 }
111+ const gradlewPath = path . join ( transformByQState . getProjectPath ( ) , 'gradlew' )
112+ if ( fs . existsSync ( gradlewPath ) ) {
113+ // TO-DO: maybe do this for mvnw too OR handle this in backend?
114+ // replace Windows CRLF characters with LF characters so that our backend build can run
115+ const wrapperData = fs . readFileSync ( gradlewPath ) . toString ( )
116+ const newWrapperData = wrapperData . replace ( / \r \n / g, '\n' )
117+ fs . writeFileSync ( gradlewPath , newWrapperData )
118+ }
111119 getLogger ( ) . info ( `CodeTransformation: set build system command to ${ transformByQState . getBuildSystemCommand ( ) } ` )
112120}
113121
Original file line number Diff line number Diff line change @@ -310,7 +310,7 @@ export enum JDKVersion {
310310
311311export enum BuildSystem {
312312 Maven = 'Maven' ,
313- Gradle = 'Gradle' ,
313+ Gradle = 'GRADLE' , // needs to be all caps for backend; TO-DO: fix this by using equalsIgnoreCase in backend
314314 Unknown = 'Unknown' ,
315315}
316316
You can’t perform that action at this time.
0 commit comments