Skip to content

Commit

Permalink
Add maven-plugin bash build script
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrodmoldrich committed Nov 16, 2019
1 parent cb45ec2 commit 363b4d5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tools/gcc-bridge/maven-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ of how to use the plugin to incorporate C sources in a Maven Project.
At this stage, the maven plugin cannot be built using gradle, and so must be built separatetly. You can do so with the following steps

1. Export the renjin toolchain to your local maven repository by invoking `./gradlew publishToMavenLocal` in the root folder of the Renjin project
2. Ensure the `<version>` in the `pom.xml` in this directory matches the version generated by `allprojects.project.version` in the `build.gradle` of the root folder
3. Invoke `mvn package` in this directory
4. Manually install the runtime jar into your local maven repository:
1. Ensure the `<version>` in the `pom.xml` in this directory matches the version generated by `allprojects.project.version` in the `build.gradle` of the root folder
1. Invoke `mvn package` in this directory
1. Manually install the runtime jar into your local maven repository:
```mvn install:install-file -Dfile=<path to renjin>/tools/gcc-bridge/runtime/build/libs/runtime-<version>.jar -DgroupId=org.renjin -DartifactId=gcc-runtime -Dversion=<version> -Dpackaging=jar```
_(adapt the `<path>` and `<version>`s to suit)_
4. Manually install the jar into your local maven repository:
1. Manually install the jar into your local maven repository:
```mvn install:install-file -Dfile=<path to maven plugn>/target/gcc-bridge-maven-plugin-<version>.jar -DgroupId=org.renjin -DartifactId=gcc-bridge-maven-plugin -Dversion=<version> -Dpackaging=jar -DpomFile=pom.xml```
_(adapt the `<path>` and `<version>`s to suit)_

The `gcc-bridge-example` should now use your local toolchain to build.
Some of the last steps are encapsulated in the `./dev-build.sh` bash script. If all steps complete successfully, the `gcc-bridge-example` should now use your local toolchain to build.

17 changes: 17 additions & 0 deletions tools/gcc-bridge/maven-plugin/dev-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash -e

if [ -z "$1" ]; then
echo "USAGE: ./dev-build.sh <version>"
echo
echo "where <version> relates to the version in './pom.xml' and the project.version property in '../../../build.gradle'"
echo "e.g., ./dev-build.sh 3.5-betadev"
exit 1
fi

[ -f "../runtime/build/libs/runtime-$1.jar" ] || { echo "Runtime library not built, run './gradlew publishToMavenLocal' in the renjin root folder, and ensure version is consistent" && exit 1; }

echo "Building..."
set -x
mvn package
mvn install:install-file -Dfile=../runtime/build/libs/runtime-$1.jar -DgroupId=org.renjin -DartifactId=gcc-runtime -Dversion=$1 -Dpackaging=jar
mvn install:install-file -Dfile=target/gcc-bridge-maven-plugin-$1.jar -DgroupId=org.renjin -DartifactId=gcc-bridge-maven-plugin -Dversion=$1 -Dpackaging=jar -DpomFile=pom.xml

0 comments on commit 363b4d5

Please sign in to comment.