From 6c5bb2c943d07d219cdc0be725d314accc0427c3 Mon Sep 17 00:00:00 2001 From: Sean Flanigan Date: Mon, 19 Jan 2015 14:58:11 +1000 Subject: [PATCH] Move mysql data (but not socket) back under 'target' --- functional-test/etc/mysql-data.groovy | 18 ------------------ functional-test/etc/mysql-socket.groovy | 17 +++++++++++++++++ functional-test/pom.xml | 8 +++++--- pom.xml | 2 +- 4 files changed, 23 insertions(+), 22 deletions(-) delete mode 100644 functional-test/etc/mysql-data.groovy create mode 100644 functional-test/etc/mysql-socket.groovy diff --git a/functional-test/etc/mysql-data.groovy b/functional-test/etc/mysql-data.groovy deleted file mode 100644 index 977b2c7a96..0000000000 --- a/functional-test/etc/mysql-data.groovy +++ /dev/null @@ -1,18 +0,0 @@ -import java.security.MessageDigest -import org.apache.commons.io.FileUtils - -def messageDigest = MessageDigest.getInstance("MD5") -messageDigest.update(project.build.directory.bytes); -String md5Hex = messageDigest.digest().encodeHex() - -File mysqlDir = new File(System.getProperty('java.io.tmpdir'), 'mysql-data-'+md5Hex) -project.properties['mysql.data'] = mysqlDir.absolutePath - -if (project.properties['delete'] == 'true') { - log.info('Deleting mysql.data directory: ' + mysqlDir) - FileUtils.deleteDirectory(mysqlDir) -} else { - log.info('Preparing mysql.data directory: ' + mysqlDir) - mysqlDir.mkdir() - FileUtils.cleanDirectory(mysqlDir) -} diff --git a/functional-test/etc/mysql-socket.groovy b/functional-test/etc/mysql-socket.groovy new file mode 100644 index 0000000000..259a4292d9 --- /dev/null +++ b/functional-test/etc/mysql-socket.groovy @@ -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(); +} diff --git a/functional-test/pom.xml b/functional-test/pom.xml index 7cd75617c8..3a1345b92c 100644 --- a/functional-test/pom.xml +++ b/functional-test/pom.xml @@ -458,7 +458,7 @@ mysql.classifier ${mysql.port} - ${mysql.data} + ${mysql.socket} @@ -693,7 +693,8 @@ true - ${project.basedir}/etc/mysql-data.groovy + + ${project.basedir}/etc/mysql-socket.groovy @@ -706,7 +707,8 @@ false - ${project.basedir}/etc/mysql-data.groovy + + ${project.basedir}/etc/mysql-socket.groovy diff --git a/pom.xml b/pom.xml index adbbf176c4..e87ab9d684 100644 --- a/pom.xml +++ b/pom.xml @@ -1006,7 +1006,7 @@ com.jcabi jcabi-mysql-maven-plugin - 0.4 + 0.9 org.codehaus.gmaven