This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move mysql data (but not socket) back under 'target'
- Loading branch information
Showing
4 changed files
with
23 additions
and
22 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 @@ | ||
// This script sets the Maven project property 'mysql.socket' | ||
// to a short path under /tmp (derived from the project build directory) | ||
// and optionally deletes the socket file if it exists. | ||
|
||
import java.security.MessageDigest | ||
|
||
def messageDigest = MessageDigest.getInstance("MD5") | ||
messageDigest.update(project.build.directory.bytes); | ||
String md5Hex = messageDigest.digest().encodeHex() | ||
|
||
File mysqlSocket = new File(System.getProperty('java.io.tmpdir'), 'mysql-'+md5Hex+'.socket') | ||
project.properties['mysql.socket'] = mysqlSocket.absolutePath | ||
|
||
if (project.properties['delete'] == 'true') { | ||
log.info('Deleting mysql.socket file: ' + mysqlSocket) | ||
mysqlSocket.delete(); | ||
} |
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
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