Skip to content
Snippets Groups Projects
Commit d85cb209 authored by dgelessus's avatar dgelessus
Browse files

Add instructions and script for updating the Rodin sources

parent be1632c6
No related branches found
No related tags found
No related merge requests found
Pipeline #121981 passed
......@@ -20,3 +20,49 @@ We also added the following files to support the Maven Central build/upload proc
* pubring.gpg.enc
* secring.gpg.enc
* settings.gradle
* update_sources.sh
## How to update this project to a new Rodin version
First, remove any local changes in your clone of this repo, to avoid possible conflicts or other issues:
```sh
$ git restore --staged --worktree . # DELETES ALL LOCAL CHANGES!
```
In a different directory, clone the rodincore repo (if you haven't already):
```sh
$ cd /some/work/directory
$ git clone "https://git.code.sf.net/p/rodin-b-sharp/rodincore" rodin-b-sharp-rodincore
$ cd rodin-b-sharp-rodincore
```
Check out the desired Rodin release, for example:
```sh
$ git switch --detach RodinCore/3.3
```
In this repo, run the `update_sources.sh` script and pass the path of the source org.eventb.core.ast project:
```sh
$ cd .../rodin_eventb_ast
$ ./update_sources.sh /some/work/directory/rodin-b-sharp-rodincore/org.eventb.core.ast
```
Update the version number in build.gradle to the appropriate version *with a SNAPSHOT suffix*, for example:
```groovy
project.version = "3.3.0-SNAPSHOT"
```
Add the version change and commit and push everything:
```sh
$ git add build.gradle
$ git commit -m "Update to Rodin 3.3 sources"
$ git push
```
Once you have confirmed that the new snapshot works, you can remove the -SNAPSHOT suffix and make a proper release to Maven Central.
#!/bin/sh
set -e -u
if [ "$#" -ne 1 ]
then
echo "$0: expected exactly 1 argument, not $#" >&2
echo "usage: $0 RODINCORE_AST_PATH" >&2
exit 2
fi
original_path="$1"
own_sources_path="$(dirname "$0")"
if [ -z "${own_sources_path}" ]
then
echo "$0: failed to determine destination path"
exit 1
fi
git rm -r \
"${own_sources_path}/build-gen.xml" \
"${own_sources_path}/build.properties" \
"${own_sources_path}/customBuildCallbacks.xml" \
"${own_sources_path}/epl-v10.html" \
"${own_sources_path}/META-INF" \
"${own_sources_path}/notice.html" \
"${own_sources_path}/plugin.properties" \
"${own_sources_path}/src" \
"${own_sources_path}/tom" \
"${own_sources_path}/tools"
cp -R \
"${original_path}/build-gen.xml" \
"${original_path}/build.properties" \
"${original_path}/customBuildCallbacks.xml" \
"${original_path}/epl-v10.html" \
"${original_path}/META-INF" \
"${original_path}/notice.html" \
"${original_path}/plugin.properties" \
"${original_path}/src" \
"${original_path}/tom" \
"${original_path}/tools" \
"${own_sources_path}"
# We replaced this file - keep our version instead of the original.
git restore --staged --worktree "${own_sources_path}/src/org/eventb/internal/core/ast/ASTPlugin.java"
git add \
"${own_sources_path}/build-gen.xml" \
"${own_sources_path}/build.properties" \
"${own_sources_path}/customBuildCallbacks.xml" \
"${own_sources_path}/epl-v10.html" \
"${own_sources_path}/META-INF" \
"${own_sources_path}/notice.html" \
"${own_sources_path}/plugin.properties" \
"${own_sources_path}/src" \
"${own_sources_path}/tom" \
"${own_sources_path}/tools"
echo "Successfully updated with sources from ${original_path}"
echo "Remember to update the version number in build.gradle!"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment