|
9 | 9 | from koala_serializer import generate |
10 | 10 |
|
11 | 11 |
|
12 | | -commands_reletive_path = 'ks/commands.ks' |
13 | | -models_reletive_path = 'ks/models.ks' |
| 12 | +ks_rel_dir = "app/ks" |
| 13 | +commands_ksfile = "commands.ks" |
| 14 | +models_ksfile = "models.ks" |
| 15 | + |
14 | 16 | destinations = [ |
15 | | - '../PythonClient', |
16 | | - '../PythonRandomClient', |
17 | | - '../CppClient/Game', |
18 | | - '../JavaClient/src' |
| 17 | + "../PythonClient/ks", |
| 18 | + "../PythonRandomClient/ks", |
| 19 | + "../CppClient/Game/ks", |
| 20 | + "../JavaClient/src/ks", |
| 21 | + "../CSharpClient/Game/KS" |
19 | 22 | ] |
20 | 23 |
|
21 | 24 | for dest in destinations: |
22 | | - for rel_path in [commands_reletive_path, models_reletive_path]: |
23 | | - path = os.path.join(dest, rel_path) |
| 25 | + for ksfile in [commands_ksfile, models_ksfile]: |
| 26 | + path = os.path.join(dest, ksfile) |
24 | 27 | if not os.path.exists(os.path.dirname(path)): |
25 | 28 | os.mkdir(os.path.dirname(path)) |
26 | | - copyfile(os.path.join('app', rel_path), path) |
| 29 | + copyfile(os.path.join(ks_rel_dir, ksfile), path) |
27 | 30 |
|
28 | 31 | all_args = [ |
29 | | - ('python', 'app/ks', 'snake_case'), |
30 | | - ('python', '../PythonClient/ks', 'snake_case'), |
31 | | - ('python', '../PythonRandomClient/ks', 'snake_case'), |
32 | | - ('cpp', '../CppClient/Game/ks', 'camelCase'), |
33 | | - ('java', '../JavaClient/src', 'camelCase') |
| 32 | + ('python', ks_rel_dir, 'snake_case'), |
| 33 | + ('python', "../PythonClient/ks", 'snake_case'), |
| 34 | + ('python', "../PythonRandomClient/ks", 'snake_case'), |
| 35 | + ('cpp', "../CppClient/Game/ks", 'camelCase'), |
| 36 | + ('java', "../JavaClient/src", 'camelCase'), |
| 37 | + ('cs', '../CSharpClient/Game/KS', 'PascalCase') |
34 | 38 | ] |
35 | 39 |
|
36 | 40 | for args in all_args: |
37 | | - generate(os.path.join('app', commands_reletive_path), *args) |
38 | | - generate(os.path.join('app', models_reletive_path), *args) |
| 41 | + generate(os.path.join(ks_rel_dir, commands_ksfile), *args) |
| 42 | + generate(os.path.join(ks_rel_dir, models_ksfile), *args) |
0 commit comments