forked from CoatiSoftware/SourcetrailDB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
155 lines (138 loc) · 6.13 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
version: 0.0.0.{build}
image: Visual Studio 2017
environment:
matrix:
- MBITS: 32
PYTHON_VERSION: 37
MSVC_VERSION: 15
DEPLOY_CORE: 1
DEPLOY_PYTHON_BINDINGS: 1
DEPLOY_JAVA_BINDINGS: 1
- MBITS: 64
PYTHON_VERSION: 37
MSVC_VERSION: 15
DEPLOY_CORE: 1
DEPLOY_PYTHON_BINDINGS: 1
DEPLOY_JAVA_BINDINGS: 1
- MBITS: 32
PYTHON_VERSION: 37
MSVC_VERSION: 14
DEPLOY_CORE: 1
DEPLOY_PYTHON_BINDINGS: 0
- MBITS: 64
PYTHON_VERSION: 37
MSVC_VERSION: 14
DEPLOY_CORE: 1
DEPLOY_PYTHON_BINDINGS: 0
install:
- ps: |
if ($env:MBITS -eq "32") {
echo "Architecture set to 32 bit."
$env:CMAKE_GENERATOR="Visual Studio $env:MSVC_VERSION"
$env:PYTHON_PATH="C:/Python$env:PYTHON_VERSION"
} elseif ($env:MBITS -eq "64") {
echo "Architecture set to 64 bit."
$env:CMAKE_GENERATOR="Visual Studio $env:MSVC_VERSION Win64"
$env:PYTHON_PATH="C:/Python$env:PYTHON_VERSION-x64"
} else {
echo "No architecture set. Build will be canceled."
}
# Install SWIG by Choco
choco install -y --no-progress swig openjdk
before_build:
- mkdir build
- cd build
- cmake -G "%CMAKE_GENERATOR%" ../ -DBUILD_BINDINGS_PYTHON=ON -DPYTHON_LIBRARY="%PYTHON_PATH%/libs/python%PYTHON_VERSION%.lib" -DBUILD_BINDINGS_JAVA=ON
- cd ../
- ps: $env:CORE_VERSION = Get-Content -Path ./version.txt
- ps: $env:UNDERSCORED_CORE_VERSION = $env:CORE_VERSION.Replace(".", "_")
- ps: echo "Core version is $env:CORE_VERSION"
# TODO: use the core version to update appveyor version here
# - ps: $env:BUILD_VERSION = "0.0.1." + $env:APPVEYOR_BUILD_NUMBER
# - ps: echo update build version to $env:BUILD_VERSION
# - ps: Update-AppveyorBuild -Version $env:BUILD_VERSION
build_script:
- cd build
- msbuild /p:configuration=Release /v:m ALL_BUILD.vcxproj
- cd ../
after_build:
- ps: $env:CORE_PACKAGE_NAME = 'sourcetraildb_core_' + $env:UNDERSCORED_CORE_VERSION + '-windows-' + $env:MBITS + 'bit-msvc' + $env:MSVC_VERSION
- ps: $env:PYTHON_PACKAGE_NAME = 'sourcetrailbd_python' + $env:PYTHON_VERSION + '_' + $env:UNDERSCORED_CORE_VERSION + '-windows-' + $env:MBITS + 'bit'
- ps: $env:JAVA_PACKAGE_NAME = 'sourcetrailbd_java_' + $env:UNDERSCORED_CORE_VERSION + '-windows-' + $env:MBITS + 'bit'
- ps: echo $env:CORE_PACKAGE_NAME
- ps: echo $env:PYTHON_PACKAGE_NAME
- ps: echo $env:JAVA_PACKAGE_NAME
- mkdir artifacts_core
- cd artifacts_core
- mkdir %CORE_PACKAGE_NAME%
- cd %CORE_PACKAGE_NAME%
- mkdir lib
- mkdir include
- mkdir license
- cd ../..
- ps: |
copy build/core/release/sourcetraildb.lib artifacts_core/$env:CORE_PACKAGE_NAME/lib/
copy build/core/include/version.h artifacts_core/$env:CORE_PACKAGE_NAME/include/
copy core/include/* artifacts_core/$env:CORE_PACKAGE_NAME/include/
copy LICENSE.txt artifacts_core/$env:CORE_PACKAGE_NAME/license/license_sourcetraildb.txt
copy external/catch/license_catch.txt artifacts_core/$env:CORE_PACKAGE_NAME/license/
copy external/cpp_sqlite/license_cpp_sqlite.txt artifacts_core/$env:CORE_PACKAGE_NAME/license/
copy external/json/license_json.txt artifacts_core/$env:CORE_PACKAGE_NAME/license/
- mkdir artifacts_bindings_python
- cd artifacts_bindings_python
- mkdir %PYTHON_PACKAGE_NAME%
- cd %PYTHON_PACKAGE_NAME%
- mkdir license
- cd ../..
- ps: |
copy build/bindings_python/release/_sourcetraildb.pyd artifacts_bindings_python/$env:PYTHON_PACKAGE_NAME/
copy build/bindings_python/sourcetraildb.py artifacts_bindings_python/$env:PYTHON_PACKAGE_NAME/
copy LICENSE.txt artifacts_bindings_python/$env:PYTHON_PACKAGE_NAME/license/license_sourcetraildb.txt
copy external/catch/license_catch.txt artifacts_bindings_python/$env:PYTHON_PACKAGE_NAME/license/
copy external/cpp_sqlite/license_cpp_sqlite.txt artifacts_bindings_python/$env:PYTHON_PACKAGE_NAME/license/
copy external/json/license_json.txt artifacts_bindings_python/$env:PYTHON_PACKAGE_NAME/license/
- mkdir artifacts_bindings_java
- cd artifacts_bindings_java
- mkdir %JAVA_PACKAGE_NAME%
- cd %JAVA_PACKAGE_NAME%
- mkdir license
- cd ../..
- ps: |
copy build/bindings_java/release/_sourcetraildb.dll artifacts_bindings_java/$env:JAVA_PACKAGE_NAME/
copy build/bindings_java/SourcetrailDB.jar artifacts_bindings_java/$env:JAVA_PACKAGE_NAME/
copy LICENSE.txt artifacts_bindings_java/$env:JAVA_PACKAGE_NAME/license/license_sourcetraildb.txt
copy external/catch/license_catch.txt artifacts_bindings_java/$env:JAVA_PACKAGE_NAME/license/
copy external/cpp_sqlite/license_cpp_sqlite.txt artifacts_bindings_java/$env:JAVA_PACKAGE_NAME/license/
copy external/json/license_json.txt artifacts_bindings_java/$env:JAVA_PACKAGE_NAME/license/
- ps: |
$env:ARTIFACTY_TO_DEPLOY = ""
if ($env:DEPLOY_CORE -eq "1") {
$env:ARTIFACTY_TO_DEPLOY = $env:ARTIFACTY_TO_DEPLOY + "," + $env:CORE_PACKAGE_NAME
}
if ($env:DEPLOY_PYTHON_BINDINGS -eq "1") {
$env:ARTIFACTY_TO_DEPLOY = $env:ARTIFACTY_TO_DEPLOY + "," + $env:PYTHON_PACKAGE_NAME
}
if ($env:DEPLOY_JAVA_BINDINGS -eq "1") {
$env:ARTIFACTY_TO_DEPLOY = $env:ARTIFACTY_TO_DEPLOY + "," + $env:JAVA_PACKAGE_NAME
}
$env:ARTIFACTY_TO_DEPLOY = $env:ARTIFACTY_TO_DEPLOY.substring(1)
echo $env:ARTIFACTY_TO_DEPLOY
test_script:
- "build\\core\\release\\test_core.exe"
artifacts:
- path: artifacts_core
name: $(CORE_PACKAGE_NAME)
type: Zip
- path: artifacts_bindings_python
name: $(PYTHON_PACKAGE_NAME)
type: Zip
- path: artifacts_bindings_java
name: $(JAVA_PACKAGE_NAME)
type: Zip
deploy:
provider: GitHub
artifact: $(ARTIFACTY_TO_DEPLOY)
auth_token:
secure: 8UwbjFrtR19GxLgL3O3efUT0Su2mp3+X23YioThJITupEvexmQJPAf3Whmmb3eeL
on:
appveyor_repo_tag: true