Skip to content
Snippets Groups Projects
Commit 3ccef72f authored by Félix  Sidokhine's avatar Félix Sidokhine Committed by Adrien Béraud
Browse files

added script and maven goals to generate versions file

removed useless json file

Change-Id: Iddc76c361491ea09f72147afae8973b230f1e279
parent ef60e350
No related branches found
No related tags found
No related merge requests found
......@@ -91,4 +91,5 @@ target/
testdb/
tomcat.*/
/jams
userguide/site
\ No newline at end of file
userguide/site
versions.json
\ No newline at end of file
......@@ -72,6 +72,29 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<version>${maven.exec.version}</version>
<executions>
<execution>
<id>Generate Version File</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>python</executable>
<arguments>
<argument>../generate-versions.py</argument>
<argument>net.jami.jams.ad.connector.ADConnector</argument>
<argument>${revision}</argument>
<argument>libs/${project.artifactId}.jar</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
......
......@@ -84,6 +84,29 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<version>${maven.exec.version}</version>
<executions>
<execution>
<id>Generate Version File</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>python</executable>
<arguments>
<argument>../generate-versions.py</argument>
<argument>net.jami.jams.authmodule.UserAuthenticationModule</argument>
<argument>${revision}</argument>
<argument>libs/${project.artifactId}.jar</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
......
import json
import sys
import hashlib
import os
os.chdir("..")
className = sys.argv[1]
version = sys.argv[2]
try:
filename = sys.argv[3].split("/")[1]
except:
filename = sys.argv[3]
try:
f = open("versions.json", "r")
map = json.loads(f.read())
except:
map = {}
map[className] = {}
map[className]['version'] = version
map[className]['filename'] = filename
md5_hash = hashlib.md5()
a_file = open("jams/" + sys.argv[3], "rb")
content = a_file.read()
md5_hash.update(content)
digest = md5_hash.hexdigest()
map[className]['md5'] = digest
f = open("versions.json", "w")
f.write(json.dumps(map,indent=4))
f.close()
......@@ -61,6 +61,29 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<version>${maven.exec.version}</version>
<executions>
<execution>
<id>Generate Version File</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>python</executable>
<arguments>
<argument>../generate-versions.py</argument>
<argument>net.jami.jams.ca.JamsCA</argument>
<argument>${revision}</argument>
<argument>libs/${project.artifactId}.jar</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
......
......@@ -62,7 +62,6 @@
</execution>
</executions>
</plugin>
</plugins>
</build>
......
......@@ -189,6 +189,29 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<version>${maven.exec.version}</version>
<executions>
<execution>
<id>Generate Version File</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>python</executable>
<arguments>
<argument>../generate-versions.py</argument>
<argument>net.jami.jams.server.Server</argument>
<argument>${revision}</argument>
<argument>${project.artifactId}.jar</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
......
......@@ -85,6 +85,29 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<version>${maven.exec.version}</version>
<executions>
<execution>
<id>Generate Version File</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>python</executable>
<arguments>
<argument>../generate-versions.py</argument>
<argument>net.jami.jams.ldap.connector.LDAPConnector</argument>
<argument>${revision}</argument>
<argument>libs/${project.artifactId}.jar</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
......
......@@ -134,6 +134,14 @@
<version>${maven.clean.version}</version>
<configuration>
<filesets>
<fileset>
<directory>.</directory>
<includes>
<include>**/*.tmp</include>
<include>**/*.log</include>
<include>**/versions.json</include>
</includes>
</fileset>
<fileset>
<directory>jams/</directory>
<includes>
......
{
"net.jami.jams.ad.connector.ADConnector": {
"version": "2.0",
"filename": "ad-connector.jar",
"md5": "bd362666285da485a316e93f934b66a7"
},
"net.jami.jams.authmodule.UserAuthenticationModule": {
"version": "2.0",
"filename": "authentication-module.jar",
"md5": "da9f724c4162593cf80f6c6e7260c1b2"
},
"net.jami.jams.server.Server": {
"version": "2.0",
"md5": "ae811d245d4e10b45f4530a08fce3c8e",
"filename": "jams-server.jar"
},
"net.jami.jams.ca.JamsCA": {
"version": "2.0",
"md5": "fbcb88fbe485c2803cc388b4a33da752",
"filename": "cryptoengine.jar"
},
"net.jami.jams.ldap.connector.LDAPConnector": {
"version": "2.0",
"md5": "366361cb125966f86ea7b2192ee9c10c",
"filename": "ldap-connector.jar"
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment