Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Move mysql data (but not socket) back under 'target'
Browse files Browse the repository at this point in the history
  • Loading branch information
seanf committed Jan 19, 2015
1 parent 49d2df9 commit 6c5bb2c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 22 deletions.
18 changes: 0 additions & 18 deletions functional-test/etc/mysql-data.groovy

This file was deleted.

17 changes: 17 additions & 0 deletions 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();
}
8 changes: 5 additions & 3 deletions functional-test/pom.xml
Expand Up @@ -458,7 +458,7 @@
<configuration>
<classifier>mysql.classifier</classifier>
<port>${mysql.port}</port>
<data>${mysql.data}</data>
<socket>${mysql.socket}</socket>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -693,7 +693,8 @@
<properties>
<delete>true</delete>
</properties>
<source>${project.basedir}/etc/mysql-data.groovy</source>
<!-- Sets property mysql.socket -->
<source>${project.basedir}/etc/mysql-socket.groovy</source>
</configuration>
</execution>
<execution>
Expand All @@ -706,7 +707,8 @@
<properties>
<delete>false</delete>
</properties>
<source>${project.basedir}/etc/mysql-data.groovy</source>
<!-- Sets property mysql.socket -->
<source>${project.basedir}/etc/mysql-socket.groovy</source>
</configuration>
</execution>
</executions>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -1006,7 +1006,7 @@
<plugin>
<groupId>com.jcabi</groupId>
<artifactId>jcabi-mysql-maven-plugin</artifactId>
<version>0.4</version>
<version>0.9</version>
</plugin>
<plugin>
<groupId>org.codehaus.gmaven</groupId>
Expand Down

0 comments on commit 6c5bb2c

Please sign in to comment.