Skip to content

Commit

Permalink
* changed the way Content is linked, Data and Effects2 are now linked…
Browse files Browse the repository at this point in the history
… from Sources, this behavior can be changed in global.props or user.props
  • Loading branch information
OndrejPetrzilka committed May 13, 2015
1 parent a41226a commit 9aa895b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
26 changes: 20 additions & 6 deletions Sources/SpaceEngineers/SpaceEngineers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup>
<ContentPath>$(ProjectDir)Content</ContentPath>
<ContentPath>$(MSBuildProjectDirectory)\Content</ContentPath>
<EffectsFromSources>true</EffectsFromSources>
<DataFromSources>true</DataFromSources>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib">
Expand Down Expand Up @@ -439,14 +441,26 @@
<Redists86 Include="$(ProjectDir)Redists\x86\*.*" />
<Redists64 Include="$(ProjectDir)Redists\x64\*.*" />
</ItemGroup>
<ItemGroup>
<ContentSubdirs Include="$([System.IO.Directory]::GetDirectories(&quot;$(ContentPath)&quot;))" />
</ItemGroup>
<Target Name="AfterBuild">
<Exec Command="echo %time% Copying content..." />
<!-- This will create Content junction (directory hardlink) in output, takes few ms -->
<RemoveDir Directories="$(OutDir)..\Content" />
<Exec Command="mklink /J &quot;$(OutDir)..\Content&quot; &quot;$(ContentPath)&quot;" IgnoreExitCode="true" />
<!-- Recreate content dir -->
<RemoveDir Directories="$(OutDir)..\Content" ContinueOnError="true" />
<MakeDir Directories="$(OutDir)..\Content" />

<!-- Link Data and Effects2 from original source (always from source location) -->
<Exec Command="mklink /J &quot;$(OutDir)..\Content\Data&quot; &quot;$(ProjectDir)Content\Data&quot;" IgnoreExitCode="true" Condition="$(DataFromSources)==true" />
<Exec Command="mklink /J &quot;$(OutDir)..\Content\Effects2&quot; &quot;$(ProjectDir)Content\Effects2&quot;" IgnoreExitCode="true" Condition="$(EffectsFromSources)==true" />

<!-- Link the rest of content subdirs (on GitHub, this is linked from Steam; on SVN this is linked from source location) -->
<Exec Command="mklink /J &quot;$(OutDir)..\Content\$([System.IO.Path]::GetFilename(%(ContentSubdirs.Identity)))&quot; &quot;%(ContentSubdirs.Identity)&quot;" IgnoreExitCode="true" />

<!-- Link shaders (this was added by JakubT?) -->
<Exec Command="mklink /J &quot;Content\Shaders&quot; &quot;..\VRage.Render11\Shaders" IgnoreExitCode="true" />
<Exec Command="echo %time% Content copied" />
<!--<Copy SourceFiles="$(ProjectDir)..\..\Utils\PrepareScriptMod.bat" DestinationFolder="$(OutDir)..\" />-->

<!-- Copy redists -->
<Copy Condition="'$(Configuration)|$(Platform)' == 'Release Official|x86'" SourceFiles="@(Redists86)" DestinationFolder="$(OutDir)" />
<Copy Condition="'$(Configuration)|$(Platform)' == 'Release Official|x64'" SourceFiles="@(Redists64)" DestinationFolder="$(OutDir)" />
</Target>
Expand Down
2 changes: 2 additions & 0 deletions global.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<PropertyGroup>
<!-- Modify the line below to contain path to SpaceEngineers\Content in Steam directory -->
<ContentPath>c:\Program Files (x86)\Steam\SteamApps\common\SpaceEngineers\Content</ContentPath>
<EffectsFromSources>true</EffectsFromSources>
<DataFromSources>true</DataFromSources>
</PropertyGroup>
<ItemDefinitionGroup />
<ItemGroup />
Expand Down

0 comments on commit 9aa895b

Please sign in to comment.