/
regen.bat
808 lines (674 loc) · 24.3 KB
/
regen.bat
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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
@echo off
setlocal EnableDelayedExpansion
set SolutionDir=%~dp0
pushd "%SolutionDir%"
echo rem CodeGen commands used for last regen > regen_last.bat
if not defined RPSMFIL (
echo RPSMFIL is not defined!
goto error
)
if not defined RPSTFIL (
echo RPSTFIL is not defined!
goto error
)
rem ================================================================================================================================
rem Specify the names of the projects to generate code into:
set ServicesProject=Services
set ModelsProject=Services.Models
set ControllersProject=Services.Controllers
set HostProject=Services.Host
set TestProject=Services.Test
set TestValuesProject=Services.Test.GetTestValues
set TraditionalBridgeProject=TraditionalBridge
rem ================================================================================================================================
rem Specify the names of the repository structures to generate code from:
set DATA_STRUCTURES=CUSTOMERS ITEMS ORDERS ORDER_ITEMS VENDORS
set DATA_ALIASES=%DATA_STRUCTURES%
set DATA_FILES=%DATA_STRUCTURES%
set FILE_STRUCTURES=%DATA_STRUCTURES%
set FILE_ALIASES=%DATA_ALIASES%
set FILE_FILES=%DATA_FILES%
rem DATA_STRUCTURES Is a list all structures that you wish to generate models, metadata and
rem controllers for. In other words it declares all of the "entities"
rem that are being represented and exposed by the OData environment. The
rem DbContextand EdmBuilder classes will be aware of the types associated
rem with These structures.
rem
rem DATA_ALIASES Is a list of alias names for the structures listed in DATA_STRUCTURES.
rem If you wish to provide alternate names for the structures being exposed
rem then list them here. Specify an alias name for each structure.
rem
rem DATA_FILES Is a list of the repository file definition names that are associated
rem with each structure listed in DATA_STRUCTURES. If you have a one to ONE
rem mapping from structures to files then you can leave the setting to
rem default to the same value as DATA_STRUCTURES, but if your structure and
rem file definitions are different, especially if you have structures that
rem are assigned to multiple file definitions, then it is important to list
rem the correct file definition assignment for each structure.
rem
rem FILE_STRUCTURES If you don't have multi-record format files then this should be the
rem same as DATA_STRUCTURES. But if you do then FILE_STRUCTURES should
rem only list ONE of the structures assigned to each file, so this list
rem will be a subset of DATA_STRUCTURES.
rem
rem FILE_ALIASES Optional aliases for the structures listed in FILE_STRUCTURES
rem
rem FILE_FILES Repository file assignments for the structures listed in FILE_STRUCTURES
rem
rem ================================================================================================================================
rem Comment or uncomment the following lines to enable or disable optional features:
set ENABLE_ODATA_ENVIRONMENT=YES
rem set EF_PROVIDER_MYSQL=-define EF_PROVIDER_MYSQL
rem set NO_CUSTOM_PLURALIZATION=-ncp
set GLOBAL_MODELSTATE_FILTER=-define GLOBAL_MODELSTATE_FILTER
set ENABLE_SELF_HOST_GENERATION=YES
rem set ENABLE_CREATE_TEST_FILES=-define ENABLE_CREATE_TEST_FILES
set DO_NOT_SET_FILE_LOGICALS=-define DO_NOT_SET_FILE_LOGICALS
set ENABLE_GET_ALL=-define ENABLE_GET_ALL
set ENABLE_GET_ONE=-define ENABLE_GET_ONE
set ENABLE_POSTMAN_TESTS=YES
set ENABLE_ALTERNATE_KEYS=-define ENABLE_ALTERNATE_KEYS
rem set ENABLE_PARTIAL_KEYS=-define ENABLE_PARTIAL_KEYS
set ENABLE_COUNT=-define ENABLE_COUNT
rem set ENABLE_PROPERTY_ENDPOINTS=-define ENABLE_PROPERTY_ENDPOINTS
set ENABLE_SELECT=-define ENABLE_SELECT
set ENABLE_FILTER=-define ENABLE_FILTER
set ENABLE_ORDERBY=-define ENABLE_ORDERBY
set ENABLE_TOP=-define ENABLE_TOP
rem set ENABLE_SKIP=-define ENABLE_SKIP
set ENABLE_RELATIONS=-define ENABLE_RELATIONS
rem set ENABLE_RELATIONS_VALIDATION=-define ENABLE_RELATIONS_VALIDATION
set ENABLE_PUT=-define ENABLE_PUT
set ENABLE_POST=-define ENABLE_POST
set ENABLE_PATCH=-define ENABLE_PATCH
set ENABLE_DELETE=-define ENABLE_DELETE
rem set ENABLE_SPROC=-define ENABLE_SPROC
rem set ENABLE_ADAPTER_ROUTING=-define ENABLE_ADAPTER_ROUTING
rem set ENABLE_AUTHENTICATION=-define ENABLE_AUTHENTICATION
rem set ENABLE_CUSTOM_AUTHENTICATION=-define ENABLE_CUSTOM_AUTHENTICATION
rem set ENABLE_FIELD_SECURITY=-define ENABLE_FIELD_SECURITY
rem set ENABLE_SIGNALR=-define ENABLE_SIGNALR
rem set ENABLE_TYPESCRIPT_GENERATION=YES
rem set ENABLE_UNIT_TEST_GENERATION=YES
rem set ENABLE_CASE_SENSITIVE_URL=-define ENABLE_CASE_SENSITIVE_URL
set ENABLE_CORS=-define ENABLE_CORS
set ENABLE_IIS_SUPPORT=-define ENABLE_IIS_SUPPORT
rem set ENABLE_OVERLAYS=-f o
rem set ENABLE_ALTERNATE_FIELD_NAMES=-af
rem set ENABLE_READ_ONLY_PROPERTIES=-define ENABLE_READ_ONLY_PROPERTIES
set ENABLE_XFSERVERPLUS_MIGRATION=YES
set ENABLE_XFSERVERPLUS_MODEL_GENERATION=YES
rem set ENABLE_XFSERVERPLUS_METHOD_STUBS=YES
rem set ENABLE_BRIDGE_OPTIONAL_PARAMETERS=YES
set ENABLE_NEWTONSOFT=-define ENABLE_NEWTONSOFT
set ENABLE_CAMEL_CASE=-define ENABLE_CAMEL_CASE
set DISABLE_USEURLS=-define DISABLE_USEURLS
if not "NONE%ENABLE_SELECT%%ENABLE_FILTER%%ENABLE_ORDERBY%%ENABLE_TOP%%ENABLE_SKIP%%ENABLE_RELATIONS%"=="NONE" (
set PARAM_OPTIONS_PRESENT=-define PARAM_OPTIONS_PRESENT
)
rem ================================================================================================================================
rem Configure standard command line options and the CodeGen environment
rem set SHOW_CODEGEN_COMMANDS=-e
set NOREPLACEOPTS=%SHOW_CODEGEN_COMMANDS% -lf -u UserDefinedTokens.tkn %NO_CUSTOM_PLURALIZATION% %GLOBAL_MODELSTATE_FILTER% %ENABLE_GET_ALL% %ENABLE_GET_ONE% %ENABLE_OVERLAYS% %DO_NOT_SET_FILE_LOGICALS% %ENABLE_ALTERNATE_FIELD_NAMES% %ENABLE_AUTHENTICATION% %ENABLE_CUSTOM_AUTHENTICATION% %ENABLE_SIGNALR% %ENABLE_FIELD_SECURITY% %ENABLE_PROPERTY_ENDPOINTS% %ENABLE_CASE_SENSITIVE_URL% %ENABLE_CREATE_TEST_FILES% %ENABLE_CORS% %ENABLE_IIS_SUPPORT% %ENABLE_DELETE% %ENABLE_PUT% %ENABLE_POST% %ENABLE_PATCH% %ENABLE_ALTERNATE_KEYS% %ENABLE_PARTIAL_KEYS% %ENABLE_RELATIONS% %ENABLE_RELATIONS_VALIDATION% %ENABLE_SELECT% %ENABLE_FILTER% %ENABLE_ORDERBY% %ENABLE_COUNT% %ENABLE_TOP% %ENABLE_SKIP% %ENABLE_SPROC% %ENABLE_ADAPTER_ROUTING% %ENABLE_READ_ONLY_PROPERTIES% %ENABLE_NEWTONSOFT% %ENABLE_CAMEL_CASE% %DISABLE_USEURLS% %PARAM_OPTIONS_PRESENT% %EF_PROVIDER_MYSQL% -rps %RPSMFIL% %RPSTFIL%
set STDOPTS=%NOREPLACEOPTS% -r
rem ================================================================================================================================
if DEFINED EF_PROVIDER_MYSQL (
set TEMPLATESUBDIR=\MySQL
)
rem ================================================================================================================================
if DEFINED ENABLE_ODATA_ENVIRONMENT (
echo .
echo ************************************************************************
echo Generating Web API/OData CRUD environment
echo rem Generating Web API/OData CRUD environment >> regen_last.bat
if NOT DEFINED EF_PROVIDER_MYSQL (
echo.
echo Generating model and metadata classes
set command=codegen ^
-s %DATA_STRUCTURES% ^
-t ODataModel ODataMetaData ^
-i Templates ^
-o %ModelsProject% ^
-n %ModelsProject% ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
)
echo.
echo Generating controller classes
set command=codegen ^
-s %DATA_STRUCTURES% ^
-t ODataController ^
-i Templates%TEMPLATESUBDIR% ^
-o %ControllersProject% ^
-n %ControllersProject% ^
%STDOPTS% -tweaks SQLNAMENO$
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
if DEFINED ENABLE_PROPERTY_ENDPOINTS (
echo.
echo Generating individual property endpoints
set command=codegen ^
-s %DATA_STRUCTURES% ^
-t ODataControllerPropertyEndpoints ^
-i Templates ^
-o %ControllersProject% ^
-n %ControllersProject% ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
)
if NOT DEFINED EF_PROVIDER_MYSQL (
echo.
echo Generating EF DbContext class
set command=codegen ^
-s %DATA_STRUCTURES% -ms ^
-t ODataDbContext ^
-i Templates ^
-o %ModelsProject% ^
-n %ModelsProject% ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
)
echo.
echo Generating OData EDM Builder class
set command=codegen ^
-s %DATA_STRUCTURES% -ms ^
-t ODataEdmBuilder ^
-i Templates%TEMPLATESUBDIR% ^
-o %ServicesProject% ^
-n %ServicesProject% ^
-ut CONTROLLERS_NAMESPACE=%ControllersProject% MODELS_NAMESPACE=%ModelsProject% ^
%STDOPTS% -tweaks SQLNAMENO$
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
echo.
echo Generating startup class
set command=codegen ^
-s %DATA_STRUCTURES% -ms ^
-t ODataStartup ^
-i Templates%TEMPLATESUBDIR% ^
-o %ServicesProject% ^
-n %ServicesProject% ^
-ut CONTROLLERS_NAMESPACE=%ControllersProject% MODELS_NAMESPACE=%ModelsProject% ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
)
rem ================================================================================
rem Postman tests for OData environment
if DEFINED ENABLE_POSTMAN_TESTS (
echo.
echo Generating Postman tests for OData environment
set command=codegen ^
-s %DATA_STRUCTURES% -ms ^
-t ODataPostManTests ^
-i Templates%TEMPLATESUBDIR% ^
-o . ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
echo.
echo Generating interface Postman tests for Traditional Bridge environment
set command=codegen ^
-t PostManDevelopmentEnvironment ^
-i Templates ^
-o . ^
%NOREPLACEOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
)
rem ================================================================================
rem Self hosting
if DEFINED ENABLE_SELF_HOST_GENERATION (
echo.
echo ************************************************************************
echo Generating self-hosting code
echo rem Generating self-hosting code >> regen_last.bat
echo.
echo Generating self-hosting environment class
set command=codegen ^
-s %FILE_STRUCTURES% -ms ^
-t ODataSelfHostEnvironment ^
-i Templates%TEMPLATESUBDIR% ^
-o %HostProject% ^
-n %HostProject% ^
-ut SERVICES_NAMESPACE=%ServicesProject% MODELS_NAMESPACE=%ModelsProject% ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
echo.
echo Generating self-hosting program
set command=codegen ^
-t ODataSelfHost ^
-i Templates ^
-o %HostProject% ^
-n %HostProject% ^
-ut SERVICES_NAMESPACE=%ServicesProject% ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
)
rem ================================================================================
rem Custom Authentication Example
if DEFINED ENABLE_CUSTOM_AUTHENTICATION (
echo ************************************************************************
echo Generating custom authentication code
echo rem Generating custom authentication code >> regen_last.bat
echo.
if not exist "%ModelsProject%\AuthenticationModels.dbl" (
echo Generating custom authentication data model class
echo.
set command=codegen ^
-t ODataCustomAuthModels ^
-i Templates ^
-o %ModelsProject% ^
-n %ModelsProject% ^
%NOREPLACEOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
echo.
)
if not exist "%ControllersProject%\AuthenticationController.dbl" (
echo Generating custom authentication controller class
echo.
set command=codegen ^
-t ODataCustomAuthController ^
-i Templates ^
-o %ControllersProject% ^
-n %ControllersProject% ^
%NOREPLACEOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
echo.
)
if not exist "%ControllersProject%\AuthenticationTools.dbl" (
echo Generating custom authentication tools class
echo.
set command=codegen ^
-t ODataCustomAuthTools ^
-i Templates ^
-o %ControllersProject% ^
-n %ControllersProject% ^
%NOREPLACEOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
echo.
)
)
rem ================================================================================
rem Unit testing project
if DEFINED EF_PROVIDER_MYSQL (
set UNITTESTTEMPLATES=ODataUnitTests
) else (
set UNITTESTTEMPLATES=ODataClientModel ODataTestDataLoader ODataUnitTests
)
if DEFINED ENABLE_UNIT_TEST_GENERATION (
echo ************************************************************************
echo Generating unit test code
echo rem Generating unit test code >> regen_last.bat
echo.
echo Generating client model, data loader and unit test classes
set command=codegen ^
-s %DATA_STRUCTURES% ^
-t %UNITTESTTEMPLATES% ^
-i Templates ^
-o %TestProject% -tf ^
-n %TestProject% ^
-ut UNIT_TEST_NAMESPACE=%TestProject% ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
echo.
echo Generating unit test environment class and hosting program
set command=codegen ^
-s %FILE_STRUCTURES% -ms ^
-t ODataUnitTestEnvironment ODataUnitTestHost ^
-i Templates ^
-o %TestProject% ^
-n %TestProject% ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
echo.
echo Generating unit test constants properties class
set command=codegen ^
-s %DATA_STRUCTURES% -ms ^
-t ODataTestConstantsProperties ^
-i Templates ^
-o %TestProject% ^
-n %TestProject% ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
echo.
echo Generating unit test key value generation program
set command=codegen ^
-s %DATA_STRUCTURES% -ms ^
-t GenerateTestValues ^
-i Templates ^
-o %TestValuesProject% ^
-n %TestValuesProject% ^
-ut UNIT_TEST_NAMESPACE=%TestProject% ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
)
rem ================================================================================
rem Generate TraditionalBridge / xfServerPlus Migration Code
rem Specify the path to a SMC export file and the method catalog location
set SMC_XML_FILE=%TraditionalBridgeProject%\MethodCatalog\smc.xml
set XFPL_SMCPATH=%TraditionalBridgeProject%\MethodCatalog
rem Specify the name of one or more interfaces defined in the SMC export file, space separated
set SMC_INTERFACES=MyApi
rem If you want to include or excluide methods from an interface, list them like this:
rem set MyAPI_INCLUDE=method1 method2 method3
rem set MyAPI_EXCLUDE=method4 method5 method6
rem Optional parameters support is for use with xfServerPlue environments that were
rem used in conjunction with xfNetLink COM, which supported optional parameters.
if DEFINED ENABLE_BRIDGE_OPTIONAL_PARAMETERS (
set BRIDGE_DISPATCHER_TEMPLATE=OptionalParameterMethodDispatchers
) else (
set BRIDGE_DISPATCHER_TEMPLATE=InterfaceMethodDispatchers
)
rem Code Generation for xfServerPlus Migration
if DEFINED ENABLE_XFSERVERPLUS_MIGRATION (
rem Generate code for each interface
for %%x in (%SMC_INTERFACES%) do (
set METHODS_TO_INCLUDE=
rem If only want to process specific methods from an interface, do this:
rem if "%%x" == "libr_commune" (set METHODS_TO_INCLUDE=-minclude %LIBR_COMMUNE_METHODS%)
set METHODS_TO_EXCLUDE=
rem Or, if you want to exclude some methods from an interface, do this:
rem if "%%x" == "InterfaceName" (set METHODS_TO_EXCLUDE=-mexclude METHOD1 METHOD2 METHOD3)
call :GenerateCodeForInterface %%x
)
rem Generate the main (multi-interface capable) dispatcher
call :GenerateMainDispatcher %SMC_INTERFACES%
rem Generate SignalR hub(s)
if DEFINED ENABLE_SIGNALR (
for %%x in (%SMC_INTERFACES%) do (
set METHODS_TO_INCLUDE=
rem If only want to process specific methods from an interface, do this:
rem if "%%x" == "libr_commune" (set METHODS_TO_INCLUDE=-minclude %LIBR_COMMUNE_METHODS%)
set METHODS_TO_EXCLUDE=
rem Or, if you want to exclude some methods from an interface, do this:
rem if "%%x" == "InterfaceName" (set METHODS_TO_EXCLUDE=-mexclude METHOD1 METHOD2 METHOD3)
call :GenerateSignalRHub %%x
)
)
)
rem ================================================================================
echo.
echo DONE!
echo.
goto done
:error
echo *** CODE GENERATION INCOMPLETE ***
:done
popd
endlocal
goto :eof
rem ================================================================================
:GenerateCodeForInterface
echo.
echo ************************************************************************
echo Generating Traditional Bridge code for interface %1
echo rem Generating Traditional Bridge code for interface %1 >> regen_last.bat
echo.
echo Generating interface method stubs [Traditional]
if defined ENABLE_XFSERVERPLUS_METHOD_STUBS (
set command=codegen ^
-smc %SMC_XML_FILE% ^
-interface %1 %METHODS_TO_INCLUDE% %METHODS_TO_EXCLUDE% ^
-t InterfaceMethodStubs ^
-i Templates\TraditionalBridge ^
-o %TraditionalBridgeProject%\source\stubs ^
-ut MODELS_NAMESPACE=%TraditionalBridgeProject%.Models ^
%STDOPTS% -tweaks PARAMDEFSTR
echo !command! >> regen_last.bat
!command!
)
echo.
echo Generating interface method dispatcher classes [Traditional]
set command=codegen ^
-smc %SMC_XML_FILE% ^
-interface %1 %METHODS_TO_INCLUDE% %METHODS_TO_EXCLUDE% ^
-t %BRIDGE_DISPATCHER_TEMPLATE% ^
-i Templates\TraditionalBridge ^
-o %TraditionalBridgeProject%\source\dispatchers ^
-n %TraditionalBridgeProject%.Dispatchers ^
-ut MODELS_NAMESPACE=%TraditionalBridgeProject%.Models ^
%STDOPTS% -tweaks PARAMDEFSTR
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
echo.
echo Generating interface dispatcher classes [Traditional]
set command=codegen ^
-smc %SMC_XML_FILE% ^
-interface %1 %METHODS_TO_INCLUDE% %METHODS_TO_EXCLUDE% ^
-t InterfaceDispatcher ^
-i Templates\TraditionalBridge ^
-o %TraditionalBridgeProject%\source\dispatchers ^
-n %TraditionalBridgeProject%.Dispatchers ^
-ut MODELS_NAMESPACE=%TraditionalBridgeProject%.Models ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
echo.
echo Generating interface data model classes [Traditional]
set command=codegen ^
-smcstrs %SMC_XML_FILE% ^
-interface %1 %METHODS_TO_INCLUDE% %METHODS_TO_EXCLUDE% ^
-t TraditionalModel TraditionalMetadata ^
-i Templates\TraditionalBridge ^
-o %TraditionalBridgeProject%\source\models ^
-n %TraditionalBridgeProject%.Models ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
echo.
echo Generating interface data model classes [.NET]
if defined ENABLE_XFSERVERPLUS_MODEL_GENERATION (
rem Ideally the same data classes are shared between OData and Traditional Bridge
rem environments. But if OData is not being used, enable this to generate Models
rem in the web service based on SMC content.
set command=codegen ^
-smcstrs %SMC_XML_FILE% ^
-interface %1 %METHODS_TO_INCLUDE% %METHODS_TO_EXCLUDE% ^
-t ODataModel ODataMetaData ^
-i Templates ^
-o %ModelsProject% ^
-n %ModelsProject% ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
)
echo.
echo Generating interface request/response DTO classes [.NET]
set command=codegen ^
-smc %SMC_XML_FILE% ^
-interface %1 %METHODS_TO_INCLUDE% %METHODS_TO_EXCLUDE% ^
-t InterfaceServiceModels ^
-i Templates\TraditionalBridge ^
-o %ModelsProject% ^
-n %1 ^
-ut MODELS_NAMESPACE=%ModelsProject% ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
echo.
echo Generating interface service classes [.NET]
set command=codegen ^
-smc %SMC_XML_FILE% ^
-interface %1 %METHODS_TO_INCLUDE% %METHODS_TO_EXCLUDE% ^
-t InterfaceService ^
-i Templates\TraditionalBridge ^
-o %ControllersProject% ^
-n %ControllersProject% ^
-ut MODELS_NAMESPACE=%ModelsProject% DTOS_NAMESPACE=%1 ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
echo.
echo Generating interface controller classes [.NET]
set command=codegen ^
-smc %SMC_XML_FILE% ^
-interface %1 %METHODS_TO_INCLUDE% %METHODS_TO_EXCLUDE% ^
-t InterfaceController ^
-i Templates\TraditionalBridge ^
-o %ControllersProject% ^
-n %ControllersProject% ^
-ut MODELS_NAMESPACE=%ModelsProject% DTOS_NAMESPACE=%1 ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
if DEFINED ENABLE_POSTMAN_TESTS (
echo.
echo Generating interface Postman tests for Traditional Bridge environment
set command=codegen ^
-smc %SMC_XML_FILE% ^
-interface %1 %METHODS_TO_INCLUDE% %METHODS_TO_EXCLUDE% ^
-t InterfacePostmanTests ^
-i Templates\TraditionalBridge ^
-o . ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
)
if DEFINED ENABLE_UNIT_TEST_GENERATION (
echo.
echo Generating interface unit tests [.NET]
set command=codegen ^
-smc %SMC_XML_FILE% ^
-interface %1 %METHODS_TO_INCLUDE% %METHODS_TO_EXCLUDE% ^
-t InterfaceUnitTests InterfaceUnitTestValues ^
-i Templates\TraditionalBridge ^
-o %TestProject% -tf ^
-n %TestProject% ^
-ut CLIENT_MODELS_NAMESPACE=%TestProject%.Models DTOS_NAMESPACE=%1 ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
set command=codegen ^
-smc %SMC_XML_FILE% ^
-interface %1 %METHODS_TO_INCLUDE% %METHODS_TO_EXCLUDE% ^
-t InterfaceTestRequests ^
-i Templates\TraditionalBridge ^
-o %TestProject%.MakeSampleRequests ^
-n %TestProject%.MakeSampleRequests ^
-ut MODELS_NAMESPACE=%ModelsProject% ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
)
if DEFINED ENABLE_TYPESCRIPT_GENERATION (
if not exist "TypeScript" mkdir "TypeScript"
echo.
echo Generating TypeScript interface methods for interface %1
echo rem Generating TypeScript interface methods for interface %1 >> regen_last.bat
set command=codegen ^
-smc %SMC_XML_FILE% ^
-interface %1 %METHODS_TO_INCLUDE% %METHODS_TO_EXCLUDE% ^
-t TypeScriptInterfaceMethods ^
-i Templates\TypeScript ^
-o TypeScript ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
echo.
echo Generating TypeScript interface structures
set command=codegen ^
-smcstrs %SMC_XML_FILE% -ms ^
-interface %1 %METHODS_TO_INCLUDE% %METHODS_TO_EXCLUDE% ^
-t TypeScriptInterfaceStructures ^
-i Templates\TypeScript ^
-o TypeScript ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
)
GOTO:eof
rem ================================================================================
:GenerateMainDispatcher
echo.
echo Generating multi-interface dispatcher class [Traditional]
echo rem Generating multi-interface dispatcher class [Traditional] >> regen_last.bat
set command=codegen ^
-smc %SMC_XML_FILE% ^
-iloop %* ^
-t InterfaceSuperDispatcher ^
-i Templates\TraditionalBridge ^
-o %TraditionalBridgeProject%\source\dispatchers ^
-n %TraditionalBridgeProject%.Dispatchers ^
-ut MODELS_NAMESPACE=%TraditionalBridgeProject%.Models ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
GOTO:eof
rem ================================================================================
:GenerateSignalRHub
echo.
echo Generating SignalR code for interface %1
echo rem Generating SignalR code for interface %1 >> regen_last.bat
set command=codegen ^
-smc %SMC_XML_FILE% ^
-interface %1 %METHODS_TO_INCLUDE% %METHODS_TO_EXCLUDE% ^
-t SignalRHub ^
-i Templates\SignalR ^
-o %ControllersProject% ^
-n %ControllersProject% ^
-ut MODELS_NAMESPACE=%ModelsProject% DTOS_NAMESPACE=%1 ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
if DEFINED ENABLE_UNIT_TEST_GENERATION (
echo.
echo Generating SignalR tests for interface %1
set command=codegen ^
-smc %SMC_XML_FILE% ^
-interface %1 %METHODS_TO_INCLUDE% %METHODS_TO_EXCLUDE% ^
-t SignalRTests ^
-i Templates\SignalR ^
-o %TestProject%\UnitTests ^
-n %TestProject%.UnitTests ^
-ut SERVICES_NAMESPACE=%ServicesProject% MODELS_NAMESPACE=%ModelsProject% ^
%STDOPTS%
echo !command! >> regen_last.bat
!command!
if ERRORLEVEL 1 goto error
)
GOTO:eof
rem ================================================================================