forked from microsoft/security-devops-actions-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.proj
32 lines (26 loc) · 1.4 KB
/
build.proj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<RepoDirectory Condition=" '$(RepoDirectory)' == '' ">$(MSBuildThisFileDirectory)</RepoDirectory>
<SrcDirectory Condition=" '$(SrcDirectory)' == '' ">$(RepoDirectory)/src</SrcDirectory>
<LibDirectory Condition=" '$(LibDirectory)' == '' ">$(RepoDirectory)/lib</LibDirectory>
<NpmInstall Condition=" '$(NpmInstall)' == ''">false</NpmInstall>
</PropertyGroup>
<Target Name="Clean">
<RemoveDir Directories="$(LibDirectory)" />
</Target>
<Target
Name="NpmInstall"
Inputs="$(RepoDirectory)"
Outputs="$(RepoDirectory)\node_modules"
Condition=" '$(NpmInstall)' == 'true' ">
<Message Text="Installing npm dependencies in: $(RepoDirectory)" />
<Exec Command="npm install" WorkingDirectory="$(RepoDirectory)" />
</Target>
<Target Name="Build" DependsOnTargets="Clean;NpmInstall">
<Message Text="Compiling microsoft-security-devops-actions-toolkit." />
<Exec Command="npx tsc" WorkingDirectory="$(RepoDirectory)" />
<Copy SourceFiles="$(RepoDirectory)/package.json" DestinationFolder="$(LibDirectory)" />
<Copy SourceFiles="$(RepoDirectory)/.npmrc" DestinationFolder="$(LibDirectory)" />
</Target>
</Project>