-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
225 lines (200 loc) · 7.05 KB
/
BUILD.bazel
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
217
218
219
220
221
222
223
224
225
load("//:config.bzl", "avc_version", "ksp_avc_version_max", "ksp_avc_version_min", "python_version", "version")
load("//tools/build:pkg.bzl", "pkg_zip")
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
- GameData/kRPC/KRPC.IO.Ports.dll is a modified binary from the Mono project.
See LICENSE.KRPC.IO.Ports
- schema/* is under the MIT license. See schema/LICENSE
Copyright 2015-2023 kRPC Org
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 },
"KSP_VERSION_MAX": { %s },
"KSP_VERSION_MIN": { %s }
}""" % (avc_version, ksp_avc_version_max, ksp_avc_version_max, ksp_avc_version_min)
genrule(
name = "ksp-avc-version",
outs = ["kRPC.version"],
cmd = 'echo \'%s\' > "$@"' % ksp_avc_version,
)
pkg_zip(
name = "krpc",
out = "krpc-%s.zip" % version,
exclude = ["*.mdb"],
files = [
":readme",
":license",
":version",
":ksp-avc-version",
"COPYING",
"COPYING.LESSER",
# Server
"//core",
"//server",
":blank_settings",
"//tools/build/ksp:Google.Protobuf",
"//tools/build/protobuf:LICENSE",
"//tools/build/ksp:KRPC.IO.Ports",
"@csharp_krpc_io_ports_license//file",
# Services
"//service/SpaceCenter",
"//service/Drawing",
"//service/InfernalRobotics",
"//service/KerbalAlarmClock",
"//service/RemoteTech",
"//service/UI",
"//service/LiDAR",
"//service/DockingCamera",
# Schema
"//protobuf:krpc.proto",
"//protobuf:LICENSE",
],
path_map = {
"kRPC.version": "GameData/kRPC/kRPC.version",
# Server
"core/": "GameData/kRPC/",
"server/": "GameData/kRPC/",
"server/src/icons": "GameData/kRPC/icons",
"tools/build/ksp/": "GameData/kRPC/",
"tools/build/protobuf/LICENSE": "LICENSE.Google.Protobuf",
"../_main~_repo_rules~csharp_krpc_io_ports_license/file/LICENSE.KRPC.IO.Ports": "LICENSE.KRPC.IO.Ports",
# Services
"service/SpaceCenter/": "GameData/kRPC/",
"service/SpaceCenter/CHANGES.txt": "GameData/kRPC/CHANGES.SpaceCenter.txt",
"service/SpaceCenter/LICENSE": "LICENSE.KRPC.SpaceCenter",
"service/SpaceCenter/src/module-manager.cfg": "GameData/kRPC/module-manager.cfg",
"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",
"service/LiDAR/": "GameData/kRPC/",
"service/LiDAR/CHANGES.txt": "GameData/kRPC/CHANGES.LiDAR.txt",
"service/DockingCamera/": "GameData/kRPC/",
"service/DockingCamera/CHANGES.txt": "GameData/kRPC/CHANGES.DockingCamera.txt",
# Module Manager
"../_main~_repo_rules~module_manager/file/ModuleManager.4.2.2.dll": "GameData/ModuleManager.4.2.2.dll",
# Schema
"protobuf/": "schema/",
},
)
test_suite(
name = "test",
tests = [
"//client/cnano:test",
"//client/cpp:test",
"//client/csharp:test",
"//client/java:test",
"//client/lua:test",
"//client/python:test",
"//client/serialio:test",
"//client/websockets:test",
"//core:test",
"//doc:test",
"//service/Drawing:test",
"//service/InfernalRobotics:test",
"//service/RemoteTech:test",
"//service/SpaceCenter:test",
"//service/UI:test",
"//tools/krpctest:test",
"//tools/krpctools:test",
],
)
test_suite(
name = "lint",
tests = [
"//client/cnano:lint",
"//client/cpp:lint",
"//client/java:lint",
"//client/python:lint",
"//client/websockets:lint",
"//doc:lint",
"//service/Drawing:lint",
"//service/InfernalRobotics:lint",
"//service/RemoteTech:lint",
"//service/SpaceCenter:lint",
"//service/UI:lint",
"//tools/krpctest:lint",
"//tools/krpctools:lint",
],
)
filegroup(
name = "csproj",
srcs = [
"//client/csharp",
"//client/csharp:KRPC.Client.Test",
"//core",
"//core:KRPC.Core.Test",
"//server",
"//service/DockingCamera",
"//service/Drawing",
"//service/InfernalRobotics",
"//service/KerbalAlarmClock",
"//service/LiDAR",
"//service/RemoteTech",
"//service/SpaceCenter",
"//service/UI",
"//tools/ServiceDefinitions",
"//tools/TestServer",
"//tools/TestingTools",
"//tools/build/ksp:KRPC.IO.Ports.dll",
],
)