Skip to content

Commit e8a029a

Browse files
author
Kapil Borle
committed
Add task to process resource file
1 parent 7a7ad57 commit e8a029a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.build.ps1

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ param(
66
[string]$Configuration = "Debug"
77
)
88

9+
$resourceScript = Join-Path $BuildRoot "New-StronglyTypedCsFileForResx.ps1"
10+
911
function Get-BuildInputs($project) {
1012
pushd $buildRoot/$project
1113
gci -Filter *.cs
@@ -69,6 +71,15 @@ function Get-TestTaskParam($project) {
6971
}
7072
}
7173

74+
function Get-ResourceTaskParam($project) {
75+
@{
76+
Inputs = "$project/Strings.resx"
77+
Outputs = "$project/Strings.cs"
78+
Jobs = {& "$resourceScript $project"}
79+
Before = "$project/build"
80+
}
81+
}
82+
7283
function Add-ProjectTask([string]$project, [string]$taskName, [hashtable]$taskParams, [string]$pathPrefix = $buildRoot) {
7384
$jobs = [scriptblock]::Create(@"
7485
pushd $pathPrefix/$project
@@ -82,6 +93,9 @@ popd
8293

8394
$projects = @("engine", "rules")
8495

96+
$projects | % {Add-ProjectTask $_ buildResource (Get-ResourceTaskParam $_)}
97+
task buildResource -Before build "engine/buildResource", "rules/buildResource"
98+
8599
$projects | % {Add-ProjectTask $_ build (Get-BuildTaskParams $_)}
86100
task build "engine/build", "rules/build"
87101

@@ -93,3 +107,7 @@ task clean "engine/clean", "rules/clean"
93107

94108
$projects | % {Add-ProjectTask $_ test (Get-TestTaskParam $_) "$BuildRoot/tests"}
95109
task test "engine/test", "rules/test"
110+
111+
task createModule {
112+
113+
}

0 commit comments

Comments
 (0)