Commit 2ee1dc15 authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Remove Maven build support, update POM

libarsnova can no longer be built by Maven. For now the POM is kept for
automated code analysis with JSHint and Sonar. The build shell script
has been removed.
parent bffe69f8
......@@ -4,10 +4,10 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.thm.arsnova</groupId>
<artifactId>libarsnova-js</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.0.0-alpha</version>
<packaging>war</packaging>
<name>libarsnova-js</name>
<description>libarsnova-js is a client library for JavaScript applications handling the communication (REST and Socket.IO) with the ARSnova backend.</description>
<description>libarsnova-js is a JavaScript client library for the Audience Response System ARSnova which transparently handles communication with the backend API.</description>
<url>http://link.audience-response.org/libarsnova-js-website</url>
<inceptionYear>2013</inceptionYear>
......@@ -29,7 +29,7 @@
<role>architect</role>
<role>developer</role>
</roles>
<url>http://www.dgerhardt.net</url>
<url>http://dgerhardt.net</url>
<email>code@dgerhardt.net</email>
</developer>
</developers>
......@@ -47,19 +47,6 @@
<sonar.language>js</sonar.language>
</properties>
<repositories>
<repository>
<id>thmrepo</id>
<name>THM Maven Repository</name>
<url>http://maven.mni.thm.de/content/repositories</url>
</repository>
<repository>
<id>thmreposnapshots</id>
<name>THM Maven Snapshot Repository</name>
<url>http://maven.mni.thm.de/content/repositories/snapshots</url>
</repository>
</repositories>
<scm>
<url>https://github.com/thm-projects/arsnova-presenter</url>
<connection>scm:git:https://github.com/thm-projects/arsnova-presenter.git</connection>
......@@ -77,7 +64,7 @@
</ciManagement>
<build>
<sourceDirectory>src/main/websources</sourceDirectory>
<sourceDirectory>${basedir}/src</sourceDirectory>
<plugins>
<plugin>
......@@ -122,75 +109,32 @@
</executions>
<configuration>
<failOnError>true</failOnError>
<configFile>src/main/config/jshint.conf.json</configFile>
<configFile>.jshintrc</configFile>
<directories>
<directory>src/main</directory>
<directory>src</directory>
</directories>
</configuration>
</plugin>
<plugin>
<groupId>com.googlecode.jslint4java</groupId>
<artifactId>jslint4java-maven-plugin</artifactId>
<version>2.0.5</version>
<configuration>
<failOnError>true</failOnError>
<options>
<browser>true</browser>
<devel>true</devel>
<white>true</white>
<predef>require, define</predef>
</options>
<includes>
<include>**/*.js</include>
</includes>
<sourceFolders>
<sourceFolder>${basedir}/src/main</sourceFolder>
</sourceFolders>
</configuration>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo message="libarsnova-js makes use of the Grunt for building. Please install Node.js if not yet installed and the following commands:" />
<echo message=" $ npm install" />
<echo message=" $ grunt" />
<fail message="libarsnova-js cannot be built by Maven. Please use Grunt instead." />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>env-prod</id>
<activation>
<activeByDefault>true</activeByDefault>
<property>
<name>env</name>
<value>prod</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.3.2</version>
<executions>
<execution>
<id>run-build-script</id>
<phase>prepare-package</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>src/main/scripts/build.sh</executable>
<workingDirectory>${basedir}</workingDirectory>
<arguments>
<argument>prod</argument>
<argument>${outputDir}</argument>
<argument>${project.version}</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
#!/bin/bash
BUILD_ENV="$1" # mandatory (prod or dev)
TARGET_PATH="$2" # mandatory
VERSION="$3" # optional
BUILD="$4" # optional
DOJO_BUILD_PATH="$TARGET_PATH/../tmp/dojo"
DATE=$(date -u +"%FT%TZ")
if [ prod != "$BUILD_ENV" ] && [ dev != "$BUILD_ENV" ]; then
echo "First parameter has to be a valid build environment (prod, dev)."
exit 1
fi
if [[ -z "$TARGET_PATH" ]]; then
echo "Second parameter has to be a valid target path."
exit 1
fi
# Update submodules
git submodule update --init
# Write build version info into JavaScript file later used by Dojo and set build profile
if [ prod = "$BUILD_ENV" ]; then
VERSION_FILE_CONTENT="define({ \
version: \"$VERSION\", \
commitId: \"$(git log -n 1 --pretty=format:%h)\", \
buildTime: \"$DATE\", \
buildNumber: \"$BUILD\" \
});"
DOJO_BUILD_PROFILE="libarsnova-application.prod"
else
VERSION_FILE_CONTENT="define({ \
version: \"DEVELOPMENT\", \
commitId: \"\", \
buildTime: \"$DATE\", \
buildNumber: \"\" \
});"
DOJO_BUILD_PROFILE="libarsnova-application.dev"
fi
mkdir -p "$DOJO_BUILD_PATH/version"
echo "$VERSION_FILE_CONTENT" > "$DOJO_BUILD_PATH/version/version.js"
# Run Dojo build script
vendor/dojotoolkit.org/util/buildscripts/build.sh \
profile="src/main/config/$DOJO_BUILD_PROFILE.profile.js" \
releaseDir="$DOJO_BUILD_PATH"
# Copy Dojo application build
cp -R "$DOJO_BUILD_PATH/dojo/dojo.js" "$TARGET_PATH"/libarsnova.js
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment