Skip to content
Snippets Groups Projects
fc-pregmod.proj 2.34 KiB
Newer Older
  • Learn to ignore specific revisions
  • ezsh's avatar
    ezsh committed
    <?xml version="1.0" encoding="utf-8"?>
    <Project DefaultTargets="FinalHTML" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    	<PropertyGroup>
    		<OutputDirectory>.\bin\</OutputDirectory>
    		<JSMoudleFileName>fc.js</JSMoudleFileName>
    	</PropertyGroup>
    
    	<PropertyGroup Condition=" '$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture)' == 'X64' ">
    		<ArchitectureSuffix>64</ArchitectureSuffix>
    	</PropertyGroup>
    	<PropertyGroup Condition=" '$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture)' == 'X86' ">
    		<ArchitectureSuffix>86</ArchitectureSuffix>
    	</PropertyGroup>
    
    	<PropertyGroup Condition=" '$([MSBuild]::IsOsPlatform(Windows))' ">
    		<TweeGoExe>tweego_win$(ArchitectureSuffix).exe</TweeGoExe>
        </PropertyGroup>
        <PropertyGroup Condition=" '$([MSBuild]::IsOsPlatform(Linux))' ">
        	<TweeGoExe>tweego_nix$(ArchitectureSuffix)</TweeGoExe>
        </PropertyGroup>
        <PropertyGroup Condition=" '$([MSBuild]::IsOsPlatform(OSX))' ">
        	<TweeGoExe>tweego_osx$(ArchitectureSuffix)</TweeGoExe>
        </PropertyGroup>
    
    	<Target Name="DisplayMessages">
    		<Message Text="ArchitectureSuffix: $(ArchitectureSuffix)" Importance="high" />
    		<Message Text="TweeGoExe: $(TweeGoExe)" Importance="high" />
    		<Message Text="PA: $([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture)" />
        </Target>
    
    	<Target Name="createDirs">
    		<MakeDir Directories="$(OutputDirectory)\resources"/>
    	</Target>
    
    	<Target Name="JSModule" DependsOnTargets="createDirs;DisplayMessages">
    		<ItemGroup>
    			<jsScripts Include=".\js\**\*.js"></jsScripts>
    		</ItemGroup>
    
    		<!-- Read the contents of the files preserving tabs/spaces. -->
    		<ItemGroup>
    			<FileContents Include="$([System.IO.File]::ReadAllText(%(jsSCripts.FullPath)))"/>
    		</ItemGroup>
    
    		<WriteLinesToFile File="$(OutputDirectory)\$(JSMoudleFileName)" Lines="@(FileContents)" Overwrite="true" />
    	</Target>
    
    	<Target Name="tmpOutput" DependsOnTargets="JSModule">
    		<Exec Command="devTools\tweeGo\$(TweeGoExe) --module=$(OutputDirectory)\$(JSMoudleFileName) --head devTools\head.html -o $(OutputDirectory)\tmp.html src\" />
    	</Target>
    
    	<Target Name="FinalHTML" DependsOnTargets="tmpOutput">
    		<Delete Files="$(OutputDirectory)\$(JSMoudleFileName)" />
    		<Move SourceFiles="$(OutputDirectory)\tmp.html" DestinationFiles="$(OutputDirectory)\FC_pregmod.html" />
    	</Target>
    </Project>