Skip to content

Commit

Permalink
Merge pull request #131 from eMoflon/hotfix/block-bad-apache-commons-…
Browse files Browse the repository at this point in the history
…logging-package

fixes/removes broken `org.apache.commons.logging` plug-in
  • Loading branch information
maxkratz authored Dec 10, 2024
2 parents cb5ed6b + ace2856 commit 58de06b
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 12 deletions.
36 changes: 24 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ jobs:
run: echo "Started CI build (Eclipse eMoflon macOS user)."
- name: Install dependencies
run: |
brew install p7zip coreutils grep wget curl
brew install p7zip coreutils grep wget curl gsed
- name: Check out repository code
uses: actions/checkout@v4
- name: Download splash image
Expand All @@ -283,7 +283,9 @@ jobs:
with:
name: com.seeq.eclipse.importprojects.jar
- name: Run build script
run: chmod +x build.sh && ./build.sh -m user -o macos
run: |
export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"
chmod +x build.sh && ./build.sh -m user -o macos
- name: Fix permissions
run: sudo xattr -cr ./eclipse/Eclipse.app
- name: Upload artifact
Expand All @@ -301,7 +303,7 @@ jobs:
run: echo "Started CI build (Eclipse eMoflon macOS dev)."
- name: Install dependencies
run: |
brew install p7zip coreutils grep wget curl
brew install p7zip coreutils grep wget curl gsed
- name: Check out repository code
uses: actions/checkout@v4
- name: Download splash image
Expand All @@ -321,7 +323,9 @@ jobs:
with:
name: com.seeq.eclipse.importprojects.jar
- name: Run build script
run: chmod +x build.sh && ./build.sh -m dev -o macos
run: |
export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"
chmod +x build.sh && ./build.sh -m dev -o macos
- name: Fix permissions
run: sudo xattr -cr ./eclipse/Eclipse.app
- name: Upload artifact
Expand All @@ -339,7 +343,7 @@ jobs:
run: echo "Started CI build (Eclipse eMoflon macOS dev HiPE)."
- name: Install dependencies
run: |
brew install p7zip coreutils grep wget curl
brew install p7zip coreutils grep wget curl gsed
- name: Check out repository code
uses: actions/checkout@v4
- name: Download splash image
Expand All @@ -359,7 +363,9 @@ jobs:
with:
name: com.seeq.eclipse.importprojects.jar
- name: Run build script
run: chmod +x build.sh && ./build.sh -m hipedev -o macos
run: |
export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"
chmod +x build.sh && ./build.sh -m hipedev -o macos
- name: Fix permissions
run: sudo xattr -cr ./eclipse/Eclipse.app
- name: Upload artifact
Expand All @@ -377,7 +383,7 @@ jobs:
run: echo "Started CI build (Eclipse eMoflon macOS user)."
- name: Install dependencies
run: |
brew install p7zip coreutils grep wget curl
brew install p7zip coreutils grep wget curl gsed
- name: Check out repository code
uses: actions/checkout@v4
- name: Download splash image
Expand All @@ -397,7 +403,9 @@ jobs:
with:
name: com.seeq.eclipse.importprojects.jar
- name: Run build script
run: chmod +x build.sh && ./build.sh -m user -o macosarm
run: |
export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"
chmod +x build.sh && ./build.sh -m user -o macosarm
- name: Fix permissions
run: sudo xattr -cr ./eclipse/Eclipse.app
- name: Upload artifact
Expand All @@ -415,7 +423,7 @@ jobs:
run: echo "Started CI build (Eclipse eMoflon macOS dev)."
- name: Install dependencies
run: |
brew install p7zip coreutils grep wget curl
brew install p7zip coreutils grep wget curl gsed
- name: Check out repository code
uses: actions/checkout@v4
- name: Download splash image
Expand All @@ -435,7 +443,9 @@ jobs:
with:
name: com.seeq.eclipse.importprojects.jar
- name: Run build script
run: chmod +x build.sh && ./build.sh -m dev -o macosarm
run: |
export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"
chmod +x build.sh && ./build.sh -m dev -o macosarm
- name: Fix permissions
run: sudo xattr -cr ./eclipse/Eclipse.app
- name: Upload artifact
Expand All @@ -453,7 +463,7 @@ jobs:
run: echo "Started CI build (Eclipse eMoflon macOS dev HiPE)."
- name: Install dependencies
run: |
brew install p7zip coreutils grep wget curl
brew install p7zip coreutils grep wget curl gsed
- name: Check out repository code
uses: actions/checkout@v4
- name: Download splash image
Expand All @@ -473,7 +483,9 @@ jobs:
with:
name: com.seeq.eclipse.importprojects.jar
- name: Run build script
run: chmod +x build.sh && ./build.sh -m hipedev -o macosarm
run: |
export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"
chmod +x build.sh && ./build.sh -m hipedev -o macosarm
- name: Fix permissions
run: sudo xattr -cr ./eclipse/Eclipse.app
- name: Upload artifact
Expand Down
32 changes: 32 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,29 @@ remove_update_sites () {
rm -rf $UPDATE_SITE_CONFIG_PATH/$UPDATE_SITE_METADATA
}

# Removes broken org.apache.commons.logging JAR from plug-ins
remove_broken_commons_logging () {
log "Removes broken org.apache.commons.logging JAR from plug-ins."
rm $ECLIPSE_BASE_PATH/plugins/org.apache.commons.logging_1.2.0.v20180409-1502.jar
# force org.eclipse.equinox to take correct JAR into account
# org.apache.commons.logging,1.2.0,plugins/org.apache.commons.logging_1.2.0.jar,4,false
sed -i '/org.apache.commons.lang3/a org.apache.commons.logging,1.2.0,plugins/org.apache.commons.logging_1.2.0.jar,4,false' $ECLIPSE_BASE_PATH/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info
# org.apache.commons.logging,1.2.0.v20180409-1502,plugins/org.apache.commons.logging_1.2.0.v20180409-1502.jar,4,false
sed -i '/org.apache.commons.logging,1.2.0.v20180409-1502,plugins\/org.apache.commons.logging_1.2.0.v20180409-1502.jar,4,false/d' $ECLIPSE_BASE_PATH/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info
}

# Copies the non-broken org.apache.commons.logging JAR from plug-ins
save_non_broken_commons_logging () {
log "Save non-broken org.apache.commons.logging JAR from plug-ins."
cp $ECLIPSE_BASE_PATH/plugins/org.apache.commons.logging_1.2.0.jar /tmp/org.apache.commons.logging_1.2.0.jar
}

# Restores the non-broken org.apache.commons.logging JAR to plug-ins
restore_non_broken_commons_logging () {
log "Restores the non-broken org.apache.commons.logging JAR from plug-ins."
cp /tmp/org.apache.commons.logging_1.2.0.jar $ECLIPSE_BASE_PATH/plugins/org.apache.commons.logging_1.2.0.jar
rm /tmp/org.apache.commons.logging_1.2.0.jar
}

#
# Script
Expand Down Expand Up @@ -247,6 +270,9 @@ fi
# Install global Eclipse settings from config file
install_global_eclipse_settings

# Save non-broken org.apache.commons.logging JAR from plug-ins
save_non_broken_commons_logging

log "Install Eclipse plug-ins."
for p in ${ORDER[@]}; do
# Check if eMoflon packages must be skipped (for dev builds).
Expand Down Expand Up @@ -291,6 +317,12 @@ else
chmod +x splash.sh && ./splash.sh deploy $VERSION $ECLIPSE_BASE_PATH
fi

# Remove broken org.apache.commons.logging JAR
remove_broken_commons_logging

# Restore non-broken org.apache.commons.logging JAR
restore_non_broken_commons_logging

log "Clean-up old archives and create new archive."
rm -f ./$OUTPUT_FILE
zip -q -r $OUTPUT_FILE eclipse
Expand Down

0 comments on commit 58de06b

Please sign in to comment.