forked from krpc/krpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD
216 lines (192 loc) · 6.31 KB
/
BUILD
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
load('/tools/build/pkg', 'pkg_zip')
load('/config', 'version', 'python_version', 'avc_version', 'ksp_avc_version')
exports_files(['COPYING', 'COPYING.LESSER'])
readme_text = """Documentation: https://krpc.github.io/krpc
Forum release thread: http://forum.kerbalspaceprogram.com/index.php?/topic/130742-105-krpc-remote-control-your-ships-using-python-c-c-lua-v021-10th-feb-2016/
Forum development thread: http://forum.kerbalspaceprogram.com/threads/69313
"""
license_text = """This license (LGPL v3) applies to all parts of kRPC except for the following:
- GameData/kRPC/KRPC.SpaceCenter.* is under the GPLv3 license.
See LICENSE.KRPC.SpaceCenter
- GameData/kRPC/Google.Protobuf.dll is a binary from Google's protobuf project.
See LICENSE.Google.Protobuf
- schema/* is under the MIT license. See schema/LICENSE
Copyright 2015-2016 djungelorm
This program is free software: you can redistribute it and/or modify
it under the terms of the Lesser GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Lesser GNU General Public License for more details.
You should have received a copy of the Lesser GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
genrule(
name = 'license',
outs = ['LICENSE'],
cmd = 'echo "%s" > "$@"' % license_text
)
genrule(
name = 'readme',
outs = ['README.txt'],
cmd = 'echo "%s" > "$@"' % readme_text,
visibility = ['//visibility:public']
)
genrule(
name = 'blank_settings',
outs = ['GameData/kRPC/PluginData/settings.cfg'],
cmd = 'echo "" > "$@"'
)
genrule(
name = 'version',
outs = ['VERSION.txt'],
cmd = 'echo "%s" > "$@"' % version,
visibility = ['//visibility:public']
)
genrule(
name = 'python_version',
outs = ['version.py'],
cmd = 'echo "__version__ = \'%s\'" > "$@"' % python_version,
visibility = ['//visibility:public']
)
ksp_avc_version = """{
"NAME": "kRPC",
"URL": "http://ksp-avc.cybutek.net/version.php?id=254",
"DOWNLOAD": "https://github.com/krpc/krpc/releases/latest",
"VERSION": { %s },
"KSP_VERSION": { %s }
}""" % (avc_version, ksp_avc_version)
genrule(
name = 'ksp-avc-version',
outs = ['kRPC.version'],
cmd = 'echo \'%s\' > "$@"' % ksp_avc_version
)
pkg_zip(
name = 'krpc',
out = 'krpc-%s.zip' % version,
files = [
':readme',
':license',
':version',
':ksp-avc-version',
'COPYING',
'COPYING.LESSER',
# Server
'//server',
':blank_settings',
'//tools/build/ksp:Google.Protobuf',
'//tools/build/protobuf:LICENSE',
# Services
'//service/SpaceCenter',
'//service/Drawing',
'//service/InfernalRobotics',
'//service/KerbalAlarmClock',
'//service/RemoteTech',
'//service/UI',
# Clients
'//client/python',
'//client/cpp',
'//client/csharp',
'//client/lua',
'//client/java',
# Schema
'//protobuf:krpc.proto',
'//protobuf:cpp',
'//protobuf:csharp',
'//protobuf:java',
'//protobuf:lua',
'//protobuf:python',
'//protobuf:LICENSE',
# Docs
'//doc:pdf',
],
path_map = {
'kRPC.version': 'GameData/kRPC/kRPC.version',
# Server
'server/': 'GameData/kRPC/',
'server/src/icons': 'GameData/kRPC/icons',
'tools/build/ksp/': 'GameData/kRPC/',
'tools/build/protobuf/LICENSE': 'LICENSE.Google.Protobuf',
# Services
'service/SpaceCenter/': 'GameData/kRPC/',
'service/SpaceCenter/CHANGES.txt': 'GameData/kRPC/CHANGES.SpaceCenter.txt',
'service/SpaceCenter/LICENSE': 'LICENSE.KRPC.SpaceCenter',
'service/Drawing/': 'GameData/kRPC/',
'service/Drawing/CHANGES.txt': 'GameData/kRPC/CHANGES.Drawing.txt',
'service/InfernalRobotics/': 'GameData/kRPC/',
'service/InfernalRobotics/CHANGES.txt': 'GameData/kRPC/CHANGES.InfernalRobotics.txt',
'service/KerbalAlarmClock/': 'GameData/kRPC/',
'service/KerbalAlarmClock/CHANGES.txt': 'GameData/kRPC/CHANGES.KerbalAlarmClock.txt',
'service/RemoteTech/': 'GameData/kRPC/',
'service/RemoteTech/CHANGES.txt': 'GameData/kRPC/CHANGES.RemoteTech.txt',
'service/UI/': 'GameData/kRPC/',
'service/UI/CHANGES.txt': 'GameData/kRPC/CHANGES.UI.txt',
# Clients
'client/csharp/': 'client/',
'client/cpp/': 'client/',
'client/java/': 'client/',
'client/lua/': 'client/',
'client/python/': 'client/',
# Schema
'protobuf/': 'schema/',
# Docs
'doc/kRPC.pdf': 'kRPC.pdf',
},
exclude = ['*.mdb']
)
test_suite(
name = 'test',
tests = [
'//server:test',
'//service/SpaceCenter:test',
'//service/Drawing:test',
'//service/InfernalRobotics:test',
'//service/KerbalAlarmClock:test',
'//service/RemoteTech:test',
'//service/UI:test',
'//client/csharp:test',
'//client/cpp:test',
'//client/java:test',
'//client/lua:test',
'//client/python:test',
'//tools/krpctest:test',
'//tools/krpctools:test',
'//tools/ServiceDefinitions:test',
'//tools/TestingTools:test',
'//tools/TestServer:test',
'//doc:test'
]
)
test_suite(
name = 'ci-test',
tests = [
'//server:ci-test',
'//client/csharp:ci-test',
'//client/cpp:ci-test',
'//client/java:ci-test',
'//client/lua:ci-test',
'//client/python:ci-test',
'//tools/krpctest:ci-test',
'//doc:ci-test'
]
)
filegroup(
name = 'csproj',
srcs = [
'//server',
'//server:KRPC.Test',
'//service/SpaceCenter',
'//service/Drawing',
'//service/InfernalRobotics',
'//service/KerbalAlarmClock',
'//service/RemoteTech',
'//service/UI',
'//client/csharp',
'//client/csharp:KRPC.Client.Test',
'//tools/ServiceDefinitions',
'//tools/TestingTools',
'//tools/TestServer'
]
)