File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,11 @@ tasks.register<Exec>("restrictDeletionOfJsonMappers") {
103103 }
104104 }
105105 if (Os .isFamily(Os .FAMILY_UNIX )) {
106- commandLine(" chmod" , " a-w" , " $buildDir /generated/source/kapt/main/META-INF/vertx" )
106+ if (System .getProperty(" user.name" ) == " root" ) {
107+ commandLine(" chattr" , " +i" , " $buildDir /generated/source/kapt/main/META-INF/vertx" )
108+ } else {
109+ commandLine(" chmod" , " a-w" , " $buildDir /generated/source/kapt/main/META-INF/vertx" )
110+ }
107111 } else {
108112 executable(" cmd.exe" )
109113 args(" /C" ) // no-op
@@ -115,7 +119,11 @@ tasks.register<Exec>("unrestrictDeletionOfJsonMappers") {
115119 mustRunAfter(" compileKotlinJvm" )
116120 if (Os .isFamily(Os .FAMILY_UNIX )) {
117121 if (file(" $buildDir /generated/source/kapt/main/META-INF/vertx" ).exists()) {
118- commandLine(" chmod" , " a+w" , " $buildDir /generated/source/kapt/main/META-INF/vertx" )
122+ if (System .getProperty(" user.name" ) == " root" ) {
123+ commandLine(" chattr" , " -i" , " $buildDir /generated/source/kapt/main/META-INF/vertx" )
124+ } else {
125+ commandLine(" chmod" , " a+w" , " $buildDir /generated/source/kapt/main/META-INF/vertx" )
126+ }
119127 } else {
120128 commandLine(" true" ) // no-op
121129 }
You can’t perform that action at this time.
0 commit comments