1
- <Project DefaultTargets =" GenerateAfterBuild" >
2
- <Target Name =" GenerateDockerfile" >
1
+ <Project xmlns =" http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets =" GenerateAfterBuild" >
2
+ <Target Name =" BaseConfig" >
3
+ <PropertyGroup >
4
+ <!-- Configuration for the base -->
5
+ <KubeOpsBasePath Condition =" '$(KubeOpsBasePath)' == ''" >$(MSBuildProjectDirectory)</KubeOpsBasePath >
6
+ </PropertyGroup >
7
+
8
+ <PropertyGroup >
9
+ <!-- Configuration for the pathes where to store the generated yamls and elements -->
10
+ <KubeOpsConfigRoot Condition =" '$(KubeOpsConfigRoot)' == ''" >$(KubeOpsBasePath)\config</KubeOpsConfigRoot >
11
+ </PropertyGroup >
12
+
3
13
<PropertyGroup >
4
14
<!-- Configuration for Docker related commands -->
5
15
<KubeOpsDockerfilePath Condition =" '$(KubeOpsDockerfilePath)' == ''" >$(KubeOpsBasePath)\Dockerfile</KubeOpsDockerfilePath >
6
16
<KubeOpsDockerTag Condition =" '$(KubeOpsDockerTag)' == ''" >latest</KubeOpsDockerTag >
7
17
</PropertyGroup >
8
18
9
- <Message Text =" Generating Dockerfile" Importance =" high" />
10
- <Message Text =" Dockerfile path: $(KubeOpsDockerfilePath)" Importance =" normal" />
11
-
12
- <Message Condition =" Exists('$(KubeOpsDockerfilePath)')" Text =" Dockerfile already exists. Don't overwrite."
13
- Importance =" high" />
14
- <Exec Condition =" !Exists('$(KubeOpsDockerfilePath)')"
15
- Command =" dotnet $(OutputPath)$(TargetFileName) generator docker --out $(KubeOpsDockerfilePath) --dotnet-tag $(KubeOpsDockerTag) --solution-dir $(SolutionDir) --target-file $(TargetFileName) --project-path $(ProjectPath)" />
16
- </Target >
17
-
18
- <Target Name =" GenerateCrds" >
19
19
<PropertyGroup >
20
20
<!-- Configuration for the crd generation -->
21
21
<KubeOpsCrdDir Condition =" '$(KubeOpsCrdDir)' == ''" >$(KubeOpsConfigRoot)\crds</KubeOpsCrdDir >
22
22
<KubeOpsCrdFormat Condition =" '$(KubeOpsCrdFormat)' == ''" >Yaml</KubeOpsCrdFormat >
23
23
<KubeOpsCrdUseOldCrds Condition =" '$(KubeOpsCrdUseOldCrds)' == ''" >false</KubeOpsCrdUseOldCrds >
24
24
</PropertyGroup >
25
25
26
- <Message Text =" Generating CRDs" Importance =" high" />
27
- <Message Text =" Configuration path: $(KubeOpsCrdDir)" Importance =" normal" />
28
-
29
- <Exec Condition =" '$(KubeOpsCrdUseOldCrds)' == 'false'"
30
- Command =" dotnet $(OutputPath)$(TargetFileName) generator crds --out $(KubeOpsCrdDir) --format $(KubeOpsCrdFormat)" />
31
- <Exec Condition =" '$(KubeOpsCrdUseOldCrds)' == 'true'"
32
- Command =" dotnet $(OutputPath)$(TargetFileName) generator crds --out $(KubeOpsCrdDir) --format $(KubeOpsCrdFormat) --use-old-crds" />
33
- </Target >
34
-
35
- <Target Name =" GenerateRbac" >
36
26
<PropertyGroup >
37
27
<!-- Configuration for the rbac generation -->
38
28
<KubeOpsRbacDir Condition =" '$(KubeOpsRbacDir)' == ''" >$(KubeOpsConfigRoot)\rbac</KubeOpsRbacDir >
39
29
<KubeOpsRbacFormat Condition =" '$(KubeOpsRbacFormat)' == ''" >Yaml</KubeOpsRbacFormat >
40
30
</PropertyGroup >
41
31
42
- <Message Text =" Generating Rbac roles" Importance =" high" />
43
- <Message Text =" Configuration path: $(KubeOpsRbacDir)" Importance =" normal" />
44
-
45
- <Exec
46
- Command =" dotnet $(OutputPath)$(TargetFileName) generator rbac --out $(KubeOpsRbacDir) --format $(KubeOpsRbacFormat)" />
47
- </Target >
48
-
49
- <Target Name =" GenerateOperator" >
50
32
<PropertyGroup >
51
33
<!-- Configuration for the operator manifest generation -->
52
34
<KubeOpsOperatorDir Condition =" '$(KubeOpsOperatorDir)' == ''" >$(KubeOpsConfigRoot)\operator</KubeOpsOperatorDir >
53
35
<KubeOpsOperatorFormat Condition =" '$(KubeOpsOperatorFormat)' == ''" >Yaml</KubeOpsOperatorFormat >
54
36
</PropertyGroup >
55
37
56
- <Message Text =" Generating Operator yamls" Importance =" high" />
57
- <Message Text =" Configuration path: $(KubeOpsOperatorDir)" Importance =" normal" />
58
-
59
- <Exec
60
- Command =" dotnet $(OutputPath)$(TargetFileName) generator operator --out $(KubeOpsOperatorDir) --format $(KubeOpsOperatorFormat)" />
61
- </Target >
62
-
63
- <Target Name =" GenerateInstaller" >
64
38
<PropertyGroup >
65
39
<!-- Configuration for the installer manifest generation -->
66
40
<KubeOpsInstallerDir Condition =" '$(KubeOpsInstallerDir)' == ''" >$(KubeOpsConfigRoot)\install</KubeOpsInstallerDir >
67
41
<KubeOpsInstallerFormat Condition =" '$(KubeOpsInstallerFormat)' == ''" >Yaml</KubeOpsInstallerFormat >
68
42
</PropertyGroup >
43
+ </Target >
69
44
70
- <Message Text =" Generating Installer yamls" Importance =" high" />
71
- <Message Text =" Configuration path: $(KubeOpsInstallerDir)" Importance =" normal" />
45
+ <Target Name =" GenerateDockerfile" DependsOnTargets =" BaseConfig" >
46
+ <Message Text =" Generating Dockerfile" Importance =" high" />
47
+ <Message Text =" Dockerfile path: $(KubeOpsDockerfilePath)" Importance =" normal" />
72
48
73
- <Message Condition =" Exists('$(KubeOpsInstallerDir )')" Text =" Installer dir exists, don 't overwrite contents ."
74
- Importance =" high" />
75
- <Exec Condition =" !Exists('$(KubeOpsInstallerDir )')"
76
- Command =" dotnet $(OutputPath)$(TargetFileName) generator installer --out $(KubeOpsInstallerDir ) --format $(KubeOpsInstallerFormat ) --crds -dir $(KubeOpsCrdDir ) --rbac-dir $(KubeOpsRbacDir ) --operator-dir $(KubeOpsOperatorDir) " />
49
+ <Message Condition =" Exists('$(KubeOpsDockerfilePath )')" Text =" Dockerfile already exists. Don 't overwrite."
50
+ Importance =" high" />
51
+ <Exec Condition =" !Exists('$(KubeOpsDockerfilePath )')"
52
+ Command =" dotnet $(OutputPath)$(TargetFileName) generator docker --out $(KubeOpsDockerfilePath ) --dotnet-tag $(KubeOpsDockerTag ) --solution -dir $(SolutionDir ) --target-file $(TargetFileName ) --project-path $(ProjectPath) " />
77
53
</Target >
78
54
79
- <Target Name =" GenerateAfterBuild" AfterTargets =" Build" >
80
- <PropertyGroup >
81
- <!-- Configuration for the base -->
82
- <KubeOpsBasePath Condition =" '$(KubeOpsBasePath)' == ''" >$(MSBuildProjectDirectory)</KubeOpsBasePath >
83
- </PropertyGroup >
55
+ <Target Name =" GenerateCrds" DependsOnTargets =" BaseConfig" >
56
+ <Message Text =" Generating CRDs" Importance =" high" />
57
+ <Message Text =" Configuration path: $(KubeOpsCrdDir)" Importance =" normal" />
84
58
85
- <PropertyGroup >
86
- <!-- Configuration for the pathes where to store the generated yamls and elements -->
87
- <KubeOpsConfigRoot Condition =" '$(KubeOpsConfigRoot)' == ''" >$(KubeOpsBasePath)\config</KubeOpsConfigRoot >
88
- </PropertyGroup >
59
+ <Exec Condition =" '$(KubeOpsCrdUseOldCrds)' == 'false'"
60
+ Command =" dotnet $(OutputPath)$(TargetFileName) generator crds --out $(KubeOpsCrdDir) --format $(KubeOpsCrdFormat)" />
61
+ <Exec Condition =" '$(KubeOpsCrdUseOldCrds)' == 'true'"
62
+ Command =" dotnet $(OutputPath)$(TargetFileName) generator crds --out $(KubeOpsCrdDir) --format $(KubeOpsCrdFormat) --use-old-crds" />
63
+ </Target >
64
+
65
+ <Target Name =" GenerateRbac" DependsOnTargets =" BaseConfig" >
66
+ <Message Text =" Generating Rbac roles" Importance =" high" />
67
+ <Message Text =" Configuration path: $(KubeOpsRbacDir)" Importance =" normal" />
68
+
69
+ <Exec
70
+ Command =" dotnet $(OutputPath)$(TargetFileName) generator rbac --out $(KubeOpsRbacDir) --format $(KubeOpsRbacFormat)" />
71
+ </Target >
72
+
73
+ <Target Name =" GenerateOperator" DependsOnTargets =" BaseConfig" >
74
+ <Message Text =" Generating Operator yamls" Importance =" high" />
75
+ <Message Text =" Configuration path: $(KubeOpsOperatorDir)" Importance =" normal" />
76
+
77
+ <Exec
78
+ Command =" dotnet $(OutputPath)$(TargetFileName) generator operator --out $(KubeOpsOperatorDir) --format $(KubeOpsOperatorFormat)" />
79
+ </Target >
80
+
81
+ <Target Name =" GenerateInstaller" DependsOnTargets =" BaseConfig" >
82
+ <Message Text =" Generating Installer yamls" Importance =" high" />
83
+ <Message Text =" Configuration path: $(KubeOpsInstallerDir)" Importance =" normal" />
84
+
85
+ <Message Condition =" Exists('$(KubeOpsInstallerDir)')" Text =" Installer dir exists, don't overwrite contents."
86
+ Importance =" high" />
87
+ <Exec Condition =" !Exists('$(KubeOpsInstallerDir)')"
88
+ Command =" dotnet $(OutputPath)$(TargetFileName) generator installer --out $(KubeOpsInstallerDir) --format $(KubeOpsInstallerFormat) --crds-dir $(KubeOpsCrdDir) --rbac-dir $(KubeOpsRbacDir) --operator-dir $(KubeOpsOperatorDir)" />
89
+ </Target >
89
90
90
- <CallTarget Condition =" '$(KubeOpsSkipDockerfile)' == ''" Targets =" GenerateDockerfile" />
91
- <CallTarget Condition =" '$(KubeOpsSkipCrds)' == ''" Targets =" GenerateCrds" />
92
- <CallTarget Condition =" '$(KubeOpsSkipRbac)' == ''" Targets =" GenerateRbac" />
93
- <CallTarget Condition =" '$(KubeOpsSkipOperator)' == ''" Targets =" GenerateOperator" />
94
- <CallTarget Condition =" '$(KubeOpsSkipInstaller)' == ''" Targets =" GenerateInstaller" />
91
+ <Target Name =" GenerateAfterBuild" AfterTargets =" Build" DependsOnTargets =" BaseConfig" >
92
+ <CallTarget Condition =" '$(KubeOpsSkipDockerfile)' == ''" Targets =" GenerateDockerfile" />
93
+ <CallTarget Condition =" '$(KubeOpsSkipCrds)' == ''" Targets =" GenerateCrds" />
94
+ <CallTarget Condition =" '$(KubeOpsSkipRbac)' == ''" Targets =" GenerateRbac" />
95
+ <CallTarget Condition =" '$(KubeOpsSkipOperator)' == ''" Targets =" GenerateOperator" />
96
+ <CallTarget Condition =" '$(KubeOpsSkipInstaller)' == ''" Targets =" GenerateInstaller" />
95
97
</Target >
96
- </Project >
98
+ </Project >
0 commit comments