Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exist-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
<groupId>org.jline</groupId>
<artifactId>jline</artifactId>
<version>4.1.3</version>
<classifier>jdk11</classifier>
<classifier>${jline.classifier}</classifier>
</dependency>

<dependency>
Expand Down
1 change: 1 addition & 0 deletions exist-distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,7 @@
<argument>${jansi.version}</argument>
<argument>${project.build.directory}/jansi-native</argument>
<argument>${mac.codesign.identity}</argument>
<argument>${jline.classifier}</argument>
</arguments>
</configuration>
</execution>
Expand Down
50 changes: 29 additions & 21 deletions exist-distribution/src/main/scripts/codesign-jansi-mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,37 +37,45 @@
# $2 is the jansi version
# $3 is temp work directory
# $4 the mac codesign identity
# $5 is the jline classifier (e.g. jdk11)


set -e
#set -x ## enable to help debug

# ensure a clean temp work directory
if [ -d "${3}/org" ]
then
rm -rf "${3}/org"
fi

# for each native arch
archs=('arm64' 'x86' 'x86_64')
for arch in ${archs[@]}
# for each jar file
for jar in "${1}/jansi-${2}.jar" "${1}/jline-${2}-${5}.jar"
do
# create the temp output dirs
mkdir -p "${3}/org/jline/nativ/Mac/${arch}"
# ensure a clean temp work directory for each jar
if [ -d "${3}/org" ]
then
rm -rf "${3}/org"
fi

# for each native arch
archs=('arm64' 'x86' 'x86_64')
for arch in "${archs[@]}"
do
# create the temp output dirs
mkdir -p "${3}/org/jline/nativ/Mac/${arch}"

# switch to temp output dir
pushd "${3}"
# switch to temp output dir
pushd "${3}"

# extract the native files
jar -xf "${1}/jansi-${2}.jar" "org/jline/nativ/Mac/${arch}/libjlinenative.jnilib"
# extract the native files
jar -xf "${jar}" "org/jline/nativ/Mac/${arch}/libjlinenative.jnilib"

# test if the file is unsigned, and sign if needed
/usr/bin/codesign --verbose --test-requirement="=anchor trusted" --verify "org/jline/nativ/Mac/${arch}/libjlinenative.jnilib" || /usr/bin/codesign --verbose --force --timestamp --sign "${4}" "org/jline/nativ/Mac/${arch}/libjlinenative.jnilib"
# test if the file is unsigned, and sign if needed
/usr/bin/codesign --verbose --test-requirement="=anchor trusted" \
--verify "org/jline/nativ/Mac/${arch}/libjlinenative.jnilib" || \
/usr/bin/codesign --verbose --force --timestamp --sign "${4}" \
"org/jline/nativ/Mac/${arch}/libjlinenative.jnilib"

# overwrite the file in the jar
jar -uf "${1}/jansi-${2}.jar" "org/jline/nativ/Mac/${arch}/libjlinenative.jnilib"
# overwrite the file in the jar
jar -uf "${jar}" "org/jline/nativ/Mac/${arch}/libjlinenative.jnilib"

# switch back from temp output dir
popd
# switch back from temp output dir
popd

done
done
1 change: 1 addition & 0 deletions exist-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
<icu.version>76.1</icu.version>
<izpack.version>5.2.5</izpack.version>
<jansi.version>4.1.3</jansi.version>
<jline.classifier>jdk11</jline.classifier>
<jaxb.api.version>4.0.5</jaxb.api.version>
<jaxb.impl.version>4.0.2</jaxb.impl.version>
<eclipse.angus-activation.version>2.0.3</eclipse.angus-activation.version>
Expand Down
Loading