Skip to content

Commit 20f572e

Browse files
authored
Merge pull request AdaCore#36 from AdaCore/topic/bin_deploy
Topic/bin deploy
2 parents f760377 + e13dc77 commit 20f572e

File tree

16 files changed

+325
-72
lines changed

16 files changed

+325
-72
lines changed

.appveyor.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ install:
55

66
build_script:
77
- C:\msys64\usr\bin\bash --login -c "$(cygpath ${APPVEYOR_BUILD_FOLDER})/integration/appveyor/appveyor.sh build"
8+
9+
artifacts:
10+
- path: win32.zip
11+
name: Ada_Language_Server
12+

.travis.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
os:
22
- linux
3+
- osx
34

45
services:
56
- docker
@@ -12,3 +13,20 @@ before_install:
1213
script:
1314
- integration/travis/travis.sh script
1415

16+
deploy:
17+
on:
18+
branch:
19+
- master
20+
skip_cleanup: true
21+
provider: bintray
22+
file: integration/travis/bintray.json
23+
user: reznikmm
24+
key:
25+
secure: "4k1wn1h79IqOJIWKrtF0hY21zL60ol4g8NHAxnUD/bQUF5AZ2/F4407lBXe6NKVn8e8GuNyeKog74lD9FR/9eG9r5MNQurUscRDQ2oK1hV2oeVUvnOdFZYobuXmv/SLsP9dVfI3cKxWHINfnzW+ugS68fUPHaXhAZU2QlvAIvvNRp34qRMs91L5rlWAp0Jg8U/ouxPP2i1CLH0YuIIF7iCBwXFW6JmPMjI9d8KZY7pP+u5QKxfHYlprM6LUFxZqX0+J4mGFRvcP8NPEhDvGKSoTVOuqFRqtb3sBwkV+iH/ImPhYKhqf931bj1dCFaUaN3gTyo4AjiySx8Z1LMSSyoBSsuVDO0UUKHvLBv8HroUcNRLI4UtCdqufi4EV86l4D9e+RYfsc019XKNoamh4eBycYgiTDH/pvnDrKyjjeZBqnwcjnXC993KxsqwZffWK49/3Vkj5aok/wSTGKq0jdwfWF5+HRzTx2yEP2M+tGPEmYyKTDQMXWfE+3AMaO7Pq3KIQcYYRNM6MTbwpBkxMIStdjinvJCzY7IbwgXb9gRvD1DCUtrgejAWefpNVwh40N857YwhYuaW/KTrXyX4eevtSbqz30cHEb/rgI6Z02XRV/FppHO6mdIotUcrHmwEk8CjN/iVc+mZe5cZIrr34F7f+bCK8CWbYxsHdzeToM5yI="
26+
27+
jobs:
28+
include:
29+
- stage: deploy
30+
os: linux
31+
before_install: echo before_install
32+
script: integration/travis/deploy.sh vsix

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
TESTER=.obj/tester/tester-run
22
TD=testsuite/ada_lsp
33
GPRBUILD=gprbuild -j0
4+
PLATFORM=$(shell node -e 'console.log(require("process").platform)')
45

56
all:
67
$(GPRBUILD) -P gnat/lsp.gpr -p
78
$(GPRBUILD) -P gnat/lsp_server.gpr -p
89
$(GPRBUILD) -P gnat/spawn_tests.gpr -p
910
$(GPRBUILD) -P gnat/tester.gpr -p
10-
rm -rf integration/vscode/ada/server
11-
ln -s ../../../.obj/server/ada_language_server integration/vscode/ada/server
11+
mkdir -p integration/vscode/ada/$(PLATFORM)
12+
cp -f .obj/server/ada_language_server.exe integration/vscode/ada/$(PLATFORM) ||\
13+
cp -f .obj/server/ada_language_server integration/vscode/ada/$(PLATFORM)
1214

1315
clean:
14-
rm -rf .obj/*.* .obj/server/* .obj/lsp/* integration/vscode/ada/server
16+
rm -rf .obj/*.* .obj/server/* .obj/lsp/* integration/vscode/ada/$(PLATFORM)
1517

1618
vscode:
1719
cd integration/vscode/ada; npm install
@@ -23,3 +25,6 @@ check: all
2325
$(TESTER) $(TD)/0002-shutdown.json
2426
$(TESTER) $(TD)/0003-get_symbols.json
2527
@echo All test passed!
28+
29+
deploy: check
30+
integration/$(USER)/deploy.sh $(PLATFORM)

gnat/spawn.gpr

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,25 @@
1717

1818
project Spawn is
1919

20-
type OS_API_Kind is ("Windows_NT", "Posix");
21-
OS_API : OS_API_Kind := external ("OS", "Posix");
20+
type OS_API_Kind is ("unix", "osx", "Windows_NT");
21+
OS_API : OS_API_Kind := external ("OS", "unix");
2222

2323
for Source_Dirs use ("../source/spawn");
2424
for Object_Dir use "../.obj/spawn";
25+
for Languages use ("Ada", "c");
2526

2627
Common_Excluded := ();
2728

2829
case OS_API is
29-
when "Posix" =>
30+
when "unix" =>
3031
for Excluded_Source_Files use Common_Excluded &
31-
("spawn-windows_api.ads",
32+
("pipe2.c",
33+
"spawn-windows_api.ads",
3234
"spawn-processes-windows.ads",
3335
"spawn-processes-windows.adb");
3436

3537
when "Windows_NT" =>
36-
for Excluded_Source_Files use Common_Excluded;
38+
for Excluded_Source_Files use Common_Excluded & ("pipe2.c");
3739
end case;
3840

3941
package Compiler is
@@ -42,7 +44,7 @@ project Spawn is
4244

4345
package Naming is
4446
case OS_API is
45-
when "Posix" =>
47+
when "unix" | "osx" =>
4648
for Spec ("Spawn.Internal")
4749
use "spawn-internal__posix.ads";
4850
for Body ("Spawn.Internal")

integration/appveyor/appveyor.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function do_install()
2626
function do_build()
2727
{
2828
cd $BUILD_FOLDER
29-
make all check
29+
make deploy USER=appveyor
3030
}
3131

3232
do_$1

integration/appveyor/deploy.sh

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/bin/bash -e
2+
3+
PLATFORM=$1
4+
DIR=integration/vscode/ada/$PLATFORM
5+
LIB=/Projects/ada-language-server/adalib/lib
6+
GNAT=/c/GNAT/
7+
8+
function add_dll()
9+
{
10+
mkdir $DIR/$1
11+
cp $2/$1.dll $DIR/$1
12+
cat > $DIR/$1/$1.manifest <<EOF
13+
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
14+
<assemblyIdentity
15+
name="$1"
16+
version="1.0.2018.0523"
17+
processorArchitecture="amd64" type="win32" />
18+
<file name="$1.dll" />
19+
</assembly>
20+
EOF
21+
22+
cat >>$DIR/ada_language_server.exe.manifest <<EOF
23+
<dependency>
24+
<dependentAssembly>
25+
<assemblyIdentity
26+
type="win32" name="$1"
27+
version="1.0.2018.0523"
28+
processorArchitecture="amd64"
29+
language="*" />
30+
</dependentAssembly>
31+
</dependency>
32+
EOF
33+
}
34+
35+
cat > $DIR/ada_language_server.exe.manifest <<EOF
36+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
37+
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
38+
manifestVersion="1.0">
39+
<assemblyIdentity version="1.0.2018.0523"
40+
processorArchitecture="amd64"
41+
name="ada_language_server"
42+
type="win32"/>
43+
EOF
44+
45+
add_dll libadalang $LIB/libadalang.relocatable
46+
add_dll libgnatcoll $LIB/gnatcoll.relocatable
47+
add_dll libgnatcoll_gmp $LIB/gnatcoll_gmp.relocatable
48+
add_dll libgnatcoll_iconv $LIB/gnatcoll_iconv.relocatable
49+
add_dll liblangkit_support $LIB/langkit_support.relocatable
50+
add_dll libxmlada_dom $GNAT/bin/
51+
add_dll libxmlada_input_sources $GNAT/bin/
52+
add_dll libxmlada_sax $GNAT/bin/
53+
add_dll libxmlada_schema $GNAT/bin/
54+
add_dll libxmlada_unicode $GNAT/bin/
55+
add_dll libgcc_s_seh-1 $GNAT/bin/
56+
add_dll libgnarl-2018 $GNAT/bin/
57+
add_dll libgnat-2018 $GNAT/bin/
58+
add_dll libgpr $GNAT/bin/
59+
add_dll libgmp-10 /mingw64/bin/
60+
add_dll libiconv-2 /mingw64/bin/
61+
62+
cat >> $DIR/ada_language_server.exe.manifest <<EOF
63+
</assembly>
64+
EOF
65+
66+
pushd integration/vscode/ada/
67+
7z a ../../../$PLATFORM.zip $PLATFORM
68+
popd

integration/travis/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
FROM debian
22
ENV PATH=/opt/gnat/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
3+
ENV USER=travis
34
RUN apt-get update && apt-get install -y \
45
libx11-xcb1 \
56
fontconfig \
@@ -8,6 +9,8 @@ RUN apt-get update && apt-get install -y \
89
make \
910
libc-dev \
1011
git \
12+
nodejs-legacy \
13+
chrpath \
1114
libgmp-dev \
1215
&& git clone https://github.com/AdaCore/gnat_community_install_script.git \
1316
&& wget -nv -O ./gnat-install \

integration/travis/bintray.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"package": {
3+
"subject": "reznikmm",
4+
"repo": "ada-language-server",
5+
"name": "ada-language-server",
6+
"desc": "Binary release of master and stable branches of ada_language_server",
7+
"labels": ["ada"],
8+
"licenses": ["GPL-3.0"],
9+
"vcs_url": "https://github.com/AdaCore/ada_language_server",
10+
"website_url": "",
11+
"issue_tracker_url": "https://github.com/AdaCore/ada_language_server/issues",
12+
"github_repo": "AdaCore/ada_language_server",
13+
"github_use_tag_release_notes": false,
14+
"public_download_numbers": true,
15+
"public_stats": true
16+
},
17+
18+
"version": {
19+
"name": "0.1-git",
20+
"desc": "This is a trunk version",
21+
"gpgSign": false
22+
},
23+
24+
"files": [{
25+
"includePattern": "upload/(.*)",
26+
"uploadPattern": "$1",
27+
"matrixParams": {
28+
"override": 1
29+
}
30+
}],
31+
"publish": true
32+
}

integration/travis/deploy.sh

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
#!/bin/bash -e
2+
3+
PLATFORM=$1
4+
DIR=integration/vscode/ada/$PLATFORM
5+
6+
function linux_deploy()
7+
{
8+
LIB=/opt/gnat/lib
9+
10+
cp --dereference $LIB/lib{adalang,langkit_support}.so $DIR
11+
cp --dereference $LIB/libgnatcoll{_gmp,_iconv,}.so.0 $DIR
12+
cp --dereference $LIB/libxmlada_{dom,input_sources,sax,schema,unicode}.so.2018 $DIR
13+
cp --dereference $LIB/libgpr.so $DIR
14+
15+
chrpath -r '$ORIGIN/' $DIR/*
16+
17+
cp $LIB/gcc/x86_64-pc-linux-gnu/7.3.1/adalib/lib{gnat,gnarl}-2018.so $DIR
18+
19+
tar czvf /upload/$PLATFORM.tar.gz -C integration/vscode/ada/ $PLATFORM
20+
}
21+
22+
function drop_rpath ()
23+
{
24+
for R in `otool -l $1 |grep -A2 LC_RPATH |awk '/ path /{ print $2 }'`; do
25+
install_name_tool -delete_rpath $R $1
26+
done
27+
}
28+
29+
30+
function darwin_deploy()
31+
{
32+
LIB=../gnat/lib
33+
34+
for J in \
35+
$LIB/libadalang.relocatable/libadalang \
36+
$LIB/gnatcoll_gmp.relocatable/libgnatcoll_gmp \
37+
$LIB/langkit_support.relocatable/liblangkit_support \
38+
$LIB/gnatcoll_iconv.relocatable/libgnatcoll_iconv \
39+
$LIB/gnatcoll.relocatable/libgnatcoll \
40+
$LIB/gpr/relocatable/gpr/libgpr \
41+
$LIB/xmlada/xmlada_schema.relocatable/libxmlada_schema \
42+
$LIB/xmlada/xmlada_dom.relocatable/libxmlada_dom \
43+
$LIB/xmlada/xmlada_sax.relocatable/libxmlada_sax \
44+
$LIB/xmlada/xmlada_input.relocatable/libxmlada_input_sources \
45+
$LIB/xmlada/xmlada_unicode.relocatable/libxmlada_unicode \
46+
$LIB/gcc/x86_64-apple-darwin16.7.0/7.3.1/adalib/libgnat-2018 \
47+
$LIB/gcc/x86_64-apple-darwin16.7.0/7.3.1/adalib/libgnarl-2018 \
48+
/usr/local/opt/gmp/lib/libgmp.10
49+
do
50+
cp -v $J.dylib $DIR
51+
drop_rpath $DIR/$J.dylib
52+
done
53+
54+
for J in $DIR/libgnatcoll_gmp.dylib $DIR/ada_language_server; do
55+
install_name_tool -change /usr/local/opt/gmp/lib/libgmp.10.dylib @rpath/libgmp.10.dylib $J
56+
done
57+
58+
drop_rpath $DIR/ada_language_server
59+
install_name_tool -add_rpath @executable_path $DIR/ada_language_server
60+
61+
mkdir upload
62+
tar czvf upload/$PLATFORM.tar.gz -C integration/vscode/ada/ $PLATFORM
63+
}
64+
65+
function vsix_deploy()
66+
{
67+
pushd integration/vscode/ada
68+
69+
wget -nv -Owin32.zip \
70+
"https://dl.bintray.com/reznikmm/ada-language-server/win32.zip"
71+
unzip win32.zip
72+
73+
for J in darwin linux ; do
74+
wget -nv -O- \
75+
"https://dl.bintray.com/reznikmm/ada-language-server/$J.tar.gz" |\
76+
tar xzvf -
77+
done
78+
79+
npm install
80+
npm install -g vsce
81+
vsce package
82+
popd
83+
mkdir upload
84+
cp -v integration/vscode/ada/*.vsix upload/
85+
}
86+
87+
${PLATFORM}_deploy

integration/travis/travis.sh

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,32 @@ function linux_before_install()
1111

1212
function linux_script()
1313
{
14-
docker run -i -t lsp /bin/bash -c \
15-
'tar xzf /tmp/lsp.tar.gz && make -C ada_language_server LIBRARY_TYPE=relocatable check'
14+
docker run -i -t -v$(pwd)/upload:/upload lsp /bin/bash -c \
15+
'tar xzf /tmp/lsp.tar.gz && make -C ada_language_server LIBRARY_TYPE=relocatable deploy'
1616

1717
}
1818

19+
GNAT_INSTALLER=gnat-community-2018-20180523-x86_64-darwin-bin.dmg
20+
INSTALL_DIR=$PWD/../gnat
21+
22+
function osx_before_install()
23+
{
24+
echo INSTALL_DIR=$INSTALL_DIR
25+
git clone https://github.com/AdaCore/gnat_community_install_script.git
26+
wget -nv -O $GNAT_INSTALLER \
27+
http://mirrors.cdn.adacore.com/art/5b071da0c7a447e573318b01
28+
sh gnat_community_install_script/install_package.sh \
29+
$GNAT_INSTALLER $INSTALL_DIR
30+
$INSTALL_DIR/bin/gprinstall --uninstall gnatcoll
31+
wget -nv -O- https://dl.bintray.com/reznikmm/libadalang/libadalang-master-osx.tar.gz \
32+
| tar xzf - -C $INSTALL_DIR
33+
}
34+
35+
function osx_script()
36+
{
37+
export PATH=$INSTALL_DIR/bin:$PATH
38+
make OS=osx LIBRARY_TYPE=relocatable all
39+
integration/travis/deploy.sh darwin
40+
}
41+
1942
${TRAVIS_OS_NAME}_$1

0 commit comments

Comments
 (0)