다음을 통해 공유


FindUnderPath 작업

업데이트: 2007년 11월

지정된 항목 컬렉션에서 지정한 폴더 또는 그 하위 폴더에 경로가 있는 항목을 확인합니다.

매개 변수

다음 표에서는 FindUnderPath 작업의 매개 변수에 대해 설명합니다.

매개 변수

설명

Files

선택적 ITaskItem[] 매개 변수입니다.

Path 매개 변수에서 지정한 경로와 해당 경로를 비교할 파일을 지정합니다.

InPath

선택적 ITaskItem[] 출력 매개 변수입니다.

지정한 경로 아래에서 찾은 항목이 들어 있습니다.

OutOfPath

선택적 ITaskItem[] 출력 매개 변수입니다.

지정한 경로 아래에서 발견되지 않은 항목이 들어 있습니다.

Path

필수적 ITaskItem 매개 변수입니다.

참조로 사용할 폴더 경로를 지정합니다.

예제

다음 예제에서는 FindUnderPath 작업을 사용하여 MyFiles 항목에 포함된 파일의 경로가 SearchPath 속성에서 지정한 경로 아래에 있는지 확인합니다. 작업이 완료된 후에 FilesNotFoundInPath 항목에는 File1.txt 파일이 포함되고 FilesFoundInPath 항목에는 File2.txt 파일이 포함됩니다.

<Project xmlns="https://schemas.microsoft.com/developer/msbuild/2003">
    <ItemGroup>
        <MyFiles Include="C:\File1.txt" />
        <MyFiles Include="C:\Projects\MyProject\File2.txt" />
    </ItemGroup>

    <PropertyGroup>
        <SearchPath>C:\Projects\MyProject</SearchPath>
    </PropertyGroup>

    <Target Name="FindFiles">
        <FindUnderPath
            Files="@(MyFiles)"
            Path="$(SearchPath)">
            <Output
                TaskParameter="InPath"
                ItemName="FilesFoundInPath" />
            <Output
                TaskParameter="OutOfPath"
                ItemName="FilesNotFoundInPath" />
        </FindUnderPath>
    </Target>

</Project>

참고 항목

개념

MSBuild 작업

기타 리소스

MSBuild 작업 참조

MSBuild 개념