我有几组项目,部分相交。所有集合都包含源文件。每个这样的集合都必须单独编译。我希望通过使用元数据来实现这一点,但我就是想不出办法。以下是我的设置:
<Content Include="src\Source.ts">
<Integration>integration</Integration>
<Development>development</Development>
</Content>
... <!-- more sources -->
<DeployLabel Include="deploy\integration\foo.js">
<Dir>integration\</Dir>
</DeployLabel>
... <!-- more targets --->
<DeployLabel Include="deploy\integration\bar.js">
<Dir>development\</Dir>
</DeployLabel>
<Target Inputs="@(DeployLabel)" Name="GenericDeploy" Outputs="%(Identity).Dummy">
<PropertyGroup>
<Deployroot>deploy\%(DeployLabel.Dir)</Deployroot>
</PropertyGroup>
<Message Text="Deploying: $$(Deploydir)"/>
<!-- how to select here only the TypeScriptCompile files
such that have metadata matching DeployLabel.Dir -->
<Exec Command="tsc --target ES3 -c -d --out $$(Deployroot) @(TypeScriptCompile ->'"%(fullpath)"', ' ')"/>
</Target>
我正在生成项目文件,所以如果它可以以不同的方式完成,但以自动方式 - 那也很好。