-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #226 from Hithran/bugfix/ISSUE-166
Fix #166 update-file-header changes file permissions: clears executab…
- Loading branch information
Showing
6 changed files
with
85 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
invoker.goals=clean license:update-file-header |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.codehaus.mojo.license.test</groupId> | ||
<artifactId>ISSUE-166</artifactId> | ||
<version>@pom.version@</version> | ||
<inceptionYear>2019</inceptionYear> | ||
|
||
<name>Test ISSUE-166</name> | ||
<url>http://www.mojohaus.org</url> | ||
|
||
<organization> | ||
<name>MojoHaus</name> | ||
</organization> | ||
|
||
<licenses> | ||
<license> | ||
<name>The GNU Lesser General Public License, Version 3.0</name> | ||
<url>http://www.gnu.org/licenses/lgpl-3.0.txt</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<license.licenseName>gpl_v3</license.licenseName> | ||
<license.keepBackup>true</license.keepBackup> | ||
</properties> | ||
|
||
<build> | ||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>license-maven-plugin</artifactId> | ||
<version>@pom.version@</version> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import java.nio.file.Files | ||
import java.nio.file.Paths | ||
|
||
scriptWithHeader = Paths.get(basedir.getAbsolutePath(), "src", "main", "bash", "license-test.sh") | ||
backupFile = Paths.get(basedir.getAbsolutePath(), "src", "main", "bash", "license-test.sh~") | ||
|
||
if(!Files.isExecutable(scriptWithHeader)) { | ||
println("Executable bit of the file $scriptWithHeader was cleared") | ||
return false | ||
} | ||
|
||
if(!Files.isExecutable(backupFile)) { | ||
println("Executable bit of the backup file $backupFile was cleared") | ||
reutrn false | ||
} | ||
|
||
return true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import java.nio.file.Files | ||
import java.nio.file.Paths | ||
|
||
// Ensure the file is executable to begin with. | ||
scriptWithoutHeader = Paths.get(basedir.getAbsolutePath(), "src", "main", "bash", "license-test.sh") | ||
|
||
if(!Files.isExecutable(scriptWithoutHeader)) | ||
scriptWithoutHeader.toFile().setExecutable(true, true) | ||
|
||
if(!Files.isExecutable(scriptWithoutHeader)) { | ||
println("File $scriptWithoutHeader is not executable") | ||
return false | ||
} | ||
return true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
# Some executable file | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters