Alice
Alice
CC#
Created by Alice on 4/7/2025 in #help
Extracting values from external data files for a property in `.csproj`?
it is quite weird -~-
12 replies
CC#
Created by Alice on 4/7/2025 in #help
Extracting values from external data files for a property in `.csproj`?
is there a reference for the syntax? because that's not at all what we would have been able to deduce ourselves
12 replies
CC#
Created by Alice on 4/7/2025 in #help
Extracting values from external data files for a property in `.csproj`?
nope, ugh well, we got a working version, if somemany knows what the actuall correct way is, we'll appreciate it greatly (main doc page on property functions was not terribly helpful in getting this resolved)
12 replies
CC#
Created by Alice on 4/7/2025 in #help
Extracting values from external data files for a property in `.csproj`?
and, we assume
<InstallLibrary>$(Libraries.Substring(0, Libraries.IndexOf('"$(HasteAppId)"')))</InstallLibrary>
<InstallLibrary>$(InstallLibrary.Substring(InstallLibrary.LastIndexOf('"path"') + 9))</InstallLibrary>
<InstallLibrary>$(InstallLibrary.Substring(0, InstallLibrary.IndexOfAny('\r\n'.ToCharArray()) - 1))/steamapps</InstallLibrary>
<InstallLibrary>$(Libraries.Substring(0, Libraries.IndexOf('"$(HasteAppId)"')))</InstallLibrary>
<InstallLibrary>$(InstallLibrary.Substring(InstallLibrary.LastIndexOf('"path"') + 9))</InstallLibrary>
<InstallLibrary>$(InstallLibrary.Substring(0, InstallLibrary.IndexOfAny('\r\n'.ToCharArray()) - 1))/steamapps</InstallLibrary>
has to be
<InstallLibrary>$('$(Libraries)'.Substring(0, '$(Libraries)'.IndexOf('"$(HasteAppId)"')))</InstallLibrary>
<InstallLibrary>$('$(InstallLibrary)'.Substring('$(InstallLibrary)'.LastIndexOf('"path"') + 9))</InstallLibrary>
<InstallLibrary>$('$(InstallLibrary)'.Substring(0, '$(InstallLibrary)'.IndexOfAny('\r\n'.ToCharArray()) - 1))/steamapps</InstallLibrary>
<InstallLibrary>$('$(Libraries)'.Substring(0, '$(Libraries)'.IndexOf('"$(HasteAppId)"')))</InstallLibrary>
<InstallLibrary>$('$(InstallLibrary)'.Substring('$(InstallLibrary)'.LastIndexOf('"path"') + 9))</InstallLibrary>
<InstallLibrary>$('$(InstallLibrary)'.Substring(0, '$(InstallLibrary)'.IndexOfAny('\r\n'.ToCharArray()) - 1))/steamapps</InstallLibrary>
instead?
12 replies
CC#
Created by Alice on 4/7/2025 in #help
Extracting values from external data files for a property in `.csproj`?
well, ugh, we spent embarrassingly long time (about 12 hours of different attempts) trying to figure out why it doesn't work, only to figure out that instead of using <Target Name="WriteBuildProperties" BeforeTargets="PreBuildEvent"><Message Text="$(InstallLibrary)" /></Target> we can write property to a file, which made us more confused as we got literal property name in the output, before we realized that property functions are really weird, and you can't really reference other properties literally, instead it has to be put in as a quoted string? so that last bit became:
<InstallLibrary>$(Libraries)</InstallLibrary>
<InstallLibrary>$([System.Text.RegularExpressions.Regex]::Replace('$(InstallLibrary)', '"$(HasteAppId)"(.|[\n\r])*', ''))</InstallLibrary>
<InstallLibrary>$([System.Text.RegularExpressions.Regex]::Replace('$(InstallLibrary)', '(.|[\n\r])*(?="path").{9}', ''))</InstallLibrary>
<InstallLibrary>$([System.Text.RegularExpressions.Regex]::Replace('$(InstallLibrary)', '"[\r\n](.|[\n\r])*', '/steamapps'))</InstallLibrary>
<InstallLibrary>$(Libraries)</InstallLibrary>
<InstallLibrary>$([System.Text.RegularExpressions.Regex]::Replace('$(InstallLibrary)', '"$(HasteAppId)"(.|[\n\r])*', ''))</InstallLibrary>
<InstallLibrary>$([System.Text.RegularExpressions.Regex]::Replace('$(InstallLibrary)', '(.|[\n\r])*(?="path").{9}', ''))</InstallLibrary>
<InstallLibrary>$([System.Text.RegularExpressions.Regex]::Replace('$(InstallLibrary)', '"[\r\n](.|[\n\r])*', '/steamapps'))</InstallLibrary>
and now we are getting what we actually expected, and build no longer fails, as well as Rider finding all the imported DLLs…
12 replies