Skip to content

Commit 2264630

Browse files
committed
KSPCommon.targets: add single quotes around all conditions
1 parent e7e7728 commit 2264630

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

KSPCommon.targets

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<!-- NuGet dependencies -->
66
<ItemGroup>
77
<!-- For GenerateKSPVersionFile -->
8-
<PackageReference Include="JsonPoke" Version="1.2.0" Condition="@(KSPVersionFile) != ''"/>
8+
<PackageReference Include="JsonPoke" Version="1.2.0" Condition="'@(KSPVersionFile)' != ''"/>
99
</ItemGroup>
1010

1111
<!--Custom Targets-->
@@ -41,8 +41,8 @@
4141
<Target Name="CKANInstallScriptGen">
4242
<ItemGroup>
4343
<_CKANCompatibleVersionItems Include="$(CKANCompatibleVersions.Split(' '))"/>
44-
<_CKANDependency Include="%(Reference.CKANIdentifier)" Condition="%(Reference.CKANVersion) == ''"/>
45-
<_CKANDependency Include="%(Reference.CKANIdentifier)=%(Reference.CKANVersion)" Condition="%(Reference.CKANVersion) != ''"/>
44+
<_CKANDependency Include="%(Reference.CKANIdentifier)" Condition="'%(Reference.CKANVersion)' == ''"/>
45+
<_CKANDependency Include="%(Reference.CKANIdentifier)=%(Reference.CKANVersion)" Condition="'%(Reference.CKANVersion)' != ''"/>
4646
<_CKANDependency Include="@(CKANDependency)"/>
4747
</ItemGroup>
4848
<PropertyGroup>
@@ -53,7 +53,7 @@
5353
<_CKANCommands Include="compat add --gamedir &quot;$(KSPROOT)&quot; %(_CKANCompatibleVersionItems.Identity)"
5454
Condition=" '$(CKANCompatibleVersions)' != '' "/>
5555

56-
<_CKANCommands Include="install --no-recommends --gamedir &quot;$(KSPROOT)&quot; $(CKANDependencyList)" Condition="$(CKANDependencyList) != ''"/>
56+
<_CKANCommands Include="install --no-recommends --gamedir &quot;$(KSPROOT)&quot; $(CKANDependencyList)" Condition="'$(CKANDependencyList)' != ''"/>
5757
</ItemGroup>
5858
<Message Text="Writing CKAN commands to $(CKANCommandFile)"/>
5959
<Message Text="@(_CKANCommands, '%0a')" Importance="Low"/>
@@ -77,7 +77,7 @@
7777
<Target Name="GetRequiredExternalTools">
7878
<ItemGroup>
7979
<CKANDependencyList Include="%(Reference.CKANIdentifier)"/>
80-
<RequiredExternalTool Include="CKAN" Condition="@(CKANDependencyList) != ''"/>
80+
<RequiredExternalTool Include="CKAN" Condition="'@(CKANDependencyList)' != ''"/>
8181
</ItemGroup>
8282
<Message Text="@(RequiredExternalTool)" Importance="high"/>
8383
</Target>
@@ -113,13 +113,13 @@
113113
Condition="'$(GenerateKSPAssemblyDependencyAttributes)' == 'true'">
114114
<ItemGroup>
115115
<Reference Update="%(Reference.identity)" Condition="'%(Reference.CKANIdentifier)%(Reference.KSPAssemblyName)' != ''">
116-
<KSPAssemblyName Condition="%(Reference.KSPAssemblyName) == ''">$([System.String]::Copy('%(Reference.identity)').Split(',')[0])</KSPAssemblyName>
117-
<KSPAssemblyVersion Condition="%(Reference.KSPAssemblyVersion) == ''">%(Reference.CKANVersion)</KSPAssemblyVersion>
118-
<KSPAssemblyVersion Condition="%(Reference.KSPAssemblyVersion) == ''">0.0.0</KSPAssemblyVersion>
116+
<KSPAssemblyName Condition="'%(Reference.KSPAssemblyName)' == ''">$([System.String]::Copy('%(Reference.identity)').Split(',')[0])</KSPAssemblyName>
117+
<KSPAssemblyVersion Condition="'%(Reference.KSPAssemblyVersion)' == ''">%(Reference.CKANVersion)</KSPAssemblyVersion>
118+
<KSPAssemblyVersion Condition="'%(Reference.KSPAssemblyVersion)' == ''">0.0.0</KSPAssemblyVersion>
119119
</Reference>
120120
</ItemGroup>
121121
<ItemGroup>
122-
<AssemblyAttribute Include="KSPAssemblyDependency" Condition="%(Reference.KSPAssemblyName) != ''">
122+
<AssemblyAttribute Include="KSPAssemblyDependency" Condition="'%(Reference.KSPAssemblyName)' != ''">
123123
<_Parameter1>%(Reference.KSPAssemblyName)</_Parameter1>
124124
<_Parameter1_TypeName>System.String</_Parameter1_TypeName>
125125
<_Parameter2>$([System.String]::Copy('%(Reference.KSPAssemblyVersion)').Split('.')[0])</_Parameter2>
@@ -144,36 +144,36 @@
144144
<Target Name="GenerateKSPVersionFile" AfterTargets="Build" Inputs="@(KSPVersionFile);$(FileVersion)" Outputs="%(KSPVersionFile.destination)">
145145
<ItemGroup>
146146
<KSPVersionFile Update="@(KSPVersionFile)">
147-
<Name Condition="%(KSPVersionFile.Name) == ''">$(ProjectName)</Name>
148-
<Version Condition="%(KSPVersionFile.Version) == ''">$(FileVersion.Split(`.`)[0]).$(FileVersion.Split(`.`)[1]).$(FileVersion.Split(`.`)[2])</Version>
147+
<Name Condition="'%(KSPVersionFile.Name)' == ''">$(ProjectName)</Name>
148+
<Version Condition="'%(KSPVersionFile.Version)' == ''">$(FileVersion.Split(`.`)[0]).$(FileVersion.Split(`.`)[1]).$(FileVersion.Split(`.`)[2])</Version>
149149
</KSPVersionFile>
150150
</ItemGroup>
151151
<ReadLinesFromFile File="%(KSPVersionFile.identity)" Condition="Exists('@(KSPVersionFile)')">
152152
<Output TaskParameter="Lines" ItemName="_JSONLines"/>
153153
</ReadLinesFromFile>
154154
<PropertyGroup>
155155
<_JSON>@(_JSONLines, '%0a')</_JSON>
156-
<_JSON Condition="@(_JSONLines) == ''">{}</_JSON>
156+
<_JSON Condition="'@(_JSONLines)' == ''">{}</_JSON>
157157
</PropertyGroup>
158158
<JsonPoke Content="$(_JSON)" Query="$.NAME" RawValue="'%(KSPVersionFile.Name)'">
159159
<Output TaskParameter="Content" PropertyName="_JSON"/>
160160
</JsonPoke>
161161
<JsonPoke Content="$(_JSON)" Query="$.VERSION" RawValue="'%(KSPVersionFile.Version)'">
162162
<Output TaskParameter="Content" PropertyName="_JSON"/>
163163
</JsonPoke>
164-
<JsonPoke Content="$(_JSON)" Query="$.URL" RawValue="'%(KSPVersionFile.URL)'" Condition="%(KSPVersionFile.URL) != ''">
164+
<JsonPoke Content="$(_JSON)" Query="$.URL" RawValue="'%(KSPVersionFile.URL)'" Condition="'%(KSPVersionFile.URL)' != ''">
165165
<Output TaskParameter="Content" PropertyName="_JSON"/>
166166
</JsonPoke>
167-
<JsonPoke Content="$(_JSON)" Query="$.DOWNLOAD" RawValue="'%(KSPVersionFile.Download)'" Condition="%(KSPVersionFile.Download) != ''">
167+
<JsonPoke Content="$(_JSON)" Query="$.DOWNLOAD" RawValue="'%(KSPVersionFile.Download)'" Condition="'%(KSPVersionFile.Download)' != ''">
168168
<Output TaskParameter="Content" PropertyName="_JSON"/>
169169
</JsonPoke>
170-
<JsonPoke Content="$(_JSON)" Query="$.KSP_VERSION" RawValue="'%(KSPVersionFile.KSP_Version)'" Condition="%(KSPVersionFile.KSP_Version) != ''">
170+
<JsonPoke Content="$(_JSON)" Query="$.KSP_VERSION" RawValue="'%(KSPVersionFile.KSP_Version)'" Condition="'%(KSPVersionFile.KSP_Version)' != ''">
171171
<Output TaskParameter="Content" PropertyName="_JSON"/>
172172
</JsonPoke>
173-
<JsonPoke Content="$(_JSON)" Query="$.KSP_VERSION_MIN" RawValue="'%(KSPVersionFile.KSP_Version_Min)'" Condition="%(KSPVersionFile.KSP_Version_Min) != ''">
173+
<JsonPoke Content="$(_JSON)" Query="$.KSP_VERSION_MIN" RawValue="'%(KSPVersionFile.KSP_Version_Min)'" Condition="'%(KSPVersionFile.KSP_Version_Min)' != ''">
174174
<Output TaskParameter="Content" PropertyName="_JSON"/>
175175
</JsonPoke>
176-
<JsonPoke Content="$(_JSON)" Query="$.KSP_VERSION_MAX" Value="'%(KSPVersionFile.KSP_Version_Max)'" Condition="%(KSPVersionFile.KSP_Version_Max) != ''">
176+
<JsonPoke Content="$(_JSON)" Query="$.KSP_VERSION_MAX" Value="'%(KSPVersionFile.KSP_Version_Max)'" Condition="'%(KSPVersionFile.KSP_Version_Max)' != ''">
177177
<Output TaskParameter="Content" PropertyName="_JSON"/>
178178
</JsonPoke>
179179
<WriteLinesToFile File="%(KSPVersionFile.Destination)" Lines="$(_JSON)" Overwrite="true"/>

0 commit comments

Comments
 (0)