Skip to content

Commit

Permalink
resolves #1 added support for different version of Corda 4. added mul…
Browse files Browse the repository at this point in the history
…ti-build process automation.
  • Loading branch information
LouKeen committed Apr 23, 2021
1 parent 9d65aa9 commit 5f509ec
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ productive with Cordaptor.
* Understand how to [configure](./docs/configuration.md) Cordaptor
* Learn how to [create extensions](./docs/extensions.md) for Cordaptor
* Stay tuned to updates in the [development blog](https://medium.com/b180tech)
* If you are developing for the Cordaptor [developer guide](./docs/developer-guide.md)

## Getting support

Expand Down
31 changes: 25 additions & 6 deletions automation.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
#Get list of configurations in Configurations file
configurations=$(ls configurations)
configurations=("4.5" "4.6" "4.7")

for configuration in $configurations; do
for configuration in "${configurations[@]}"; do

#If-Else statement to check tag the platform version based on corda version
if [ "$configuration" == "4.5" ]; then
platform_version=7;
elif [ "$configuration" == "4.6" ]; then
platform_version=8;
elif [ "$configuration" == "4.7" ]; then
platform_version=9;
fi

#Replaces version of Corda in gradle.properties file
sed -i "/corda_core_release_version/c\corda_core_release_version=$configuration" ./gradle.properties
sed -i "/corda_release_version/c\corda_release_version=$configuration" ./gradle.properties
sed -i "/cordaptor_version/c\cordaptor_version=0.2.0-corda$configuration-SNAPSHOT" ./gradle.properties

#Replaces target and minimum platform version in build.gradle under reference-cordapp project
sed -i "/targetPlatformVersion/c\ \ttargetPlatformVersion $platform_version" ./reference-cordapp/build.gradle
sed -i "/minimumPlatformVersion/c\ \tminimumPlatformVersion $platform_version" ./reference-cordapp/build.gradle

#Import configurations from the configurations folder to the root build directory
cp configurations/"$configuration"gradle.properties gradle.properties
cp configurations/"$configuration"buildFile reference-cordapp/build.gradle

#Build with imported configurations
./gradlew build
Expand All @@ -14,7 +29,11 @@ for configuration in $configurations; do
./gradlew --stop

#Gradle task to create and push docker image of current Corda Version
./gradlew :tar:dockerPush
if [ "$1" == "dockerPush" ]; then
./gradlew :tar:dockerPush
else
./gradlew :tar:docker
fi

#Task for getting cordaptor embedded jar and test results
./gradlew automatedResults
Expand Down
11 changes: 11 additions & 0 deletions docs/developer-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Developer Guide

## Automated Building (Corda version 4.5-4.7)

By using the included `automation.sh` file in the root directory you could automatically build and test the Cordaptor through Corda versions 4.5 to 4.7
(This could be changed by changing the `configurations` variable found inside the `automation.sh` file).
The `dockerPush` argument could be added which enables the shell scripts ability to push the docker build directly to the remote repository.
### Example
```
./automation.sh dockerPush
```

0 comments on commit 5f509ec

Please sign in to comment.