# 어셈블리 정의 파일 포맷 레퍼런스

> Assembly definition file format reference.

어셈블리 정의 에셋과 어셈블리 정의 레퍼런스 에셋은 JSON 파일입니다. **인스펙터** 창을 통해 Unity 에디터 내에서 에셋 파일을 편집하거나, 외부 툴을 이용하여 JSON 콘텐츠를 수정할 수도 있습니다.

## 어셈블리 정의 JSON##assembly-definition-json

어셈블리 정의는 다음 필드가 포함된 JSON 객체입니다.

#### allowUnsafeCode bool

선택 사항이며, 기본값은 true입니다. \['안전하지 않은' 코드 허용]을 참조하십시오.

```yml
"allowUnsafeCode" : true
```

#### autoReferenced bool

선택 사항이며, 기본값은 true입니다. \[자동 참조]를 참조하십시오.

```yml
"autoReferenced": false
```

#### defineConstraints string\[]

선택 사항이며, 제약 역할을 하는 심볼입니다. 비어 있을 수 있습니다. \[제약 정의]를 참조하십시오.

```yml
"defineConstraints": [
        "UNITY_2019",
        "UNITY_INCLUDE_TESTS"
    ]
```

#### excludePlatforms string\[]

선택 사항이며, 제외할 플랫폼 이름 문자열 또는 빈 배열입니다. [includePlatforms](#include-platforms)에 값이 포함되어 있으면 excludePlatforms 배열이 비어 있어야 합니다. [CompilationPipeline.GetAssemblyDefinitionPlatforms](/engine/6000.0/script-reference/unity-editor-compilation/compilation-pipeline/get-assembly-definition-platforms.md) 함수를 사용하여 플랫폼 이름 문자열을 가져올 수 있습니다(이 함수를 호출할 때 현재 에디터에 플랫폼 지원이 설치되어 있어야 함). \[플랫폼]을 참조하십시오.

```yml
"includePlatforms": [],
"excludePlatforms": [
        "iOS",
        "macOSStandalone",
        "tvOS"
]
```

#### includePlatforms string\[]

선택 사항이며, 포함할 플랫폼 이름 문자열 또는 빈 배열입니다. [excludePlatforms](#exclude-platforms)에 값이 포함되어 있으면 includePlatforms 배열이 비어 있어야 합니다. [CompilationPipeline.GetAssemblyDefinitionPlatforms](/engine/6000.0/script-reference/unity-editor-compilation/compilation-pipeline/get-assembly-definition-platforms.md) 함수를 사용하여 플랫폼 이름 문자열을 가져올 수 있습니다(이 함수를 호출할 때 현재 에디터에 플랫폼 지원이 설치되어 있어야 함). \[플랫폼]을 참조하십시오.

```yml
"includePlatforms": [
        "Android",
        "LinuxStandalone64",
        "WebGL"
],
"excludePlatforms": []
```

#### 이름 문자열

필수입니다. 모든 \[합법적인 어셈블리 이름]입니다.

```yml
"name" : "MyAssemblyName" 
```

#### noEngineReferences bool

선택 사항이며, 기본값은 true입니다. \[엔진 레퍼런스 없음]을 참조하십시오.

```yml
"noEngineReferences": false
```

#### optionalUnityReferences string\[]

선택 사항이며, 이전 버전의 Unity에서 이 필드는 어셈블리를 테스트 어셈블리로 지정하는 데 사용되는 **Unity References : Test Assemblies** 옵션을 직렬화했습니다. Unity 2019.3부터 이 옵션은 더 이상 표시되지 않습니다. 이 필드는 계속 지원되지만, 에셋이 최신 버전의 Unity 에디터에서 다시 직렬화되면 해당 필드가 해당 어셈블리 레퍼런스로 대체됩니다.

테스트 어셈블리에 대한 자세한 내용은 \[테스트 어셈블리 생성]을 참조하십시오.

```yml
"optionalUnityReferences": [
    "TestAssemblies"
  ]
```

#### overrideReferences bool

선택 사항이며, [precompiledReferences](#precompiled-references)에 값이 포함된 경우 true로 설정됩니다. 기본값은 true입니다.

\[오버라이드 레퍼런스]를 참조하십시오.

```yml
"overrideReferences": true
```

#### precompiledReferences string\[]

선택 사항이며, 확장자를 포함하지만 다른 경로 요소는 포함하지 않는 참조된 DLL 라이브러리의 파일 이름입니다. 비어 있을 수 있습니다. [overrideReferences](#override-references)를 true로 설정하지 않으면 이 배열은 무시됩니다.

\[어셈블리 레퍼런스]를 참조하십시오.

```yml
"overrideReferences": true,
"precompiledReferences": [
        "Newtonsoft.Json.dll",
        "nunit.framework.dll"
]
```

#### references string\[]

선택 사항이며, 어셈블리 정의 에셋을 사용하여 생성한 다른 어셈블리에 대한 레퍼런스입니다. 어셈블리 정의 에셋 파일의 GUID 또는 어셈블리 정의의 [name](/engine/6000.0/manual/scripting/compilation-and-code-reload/script-compilation/assembly-definition-files/class-assembly-definition-importer.md#name) 필드에 정의된 어셈블리의 이름을 사용할 수 있습니다. 리스트의 모든 레퍼런스에 동일한 양식을 사용해야 합니다. 비어 있을 수 있습니다.

[AssetDatabase.AssetPathToGUID](/engine/6000.0/script-reference/unity-editor/asset-database/asset-path-to-guid.md) 함수를 사용하여 에셋의 GUID를 가져올 수 있습니다. (GUID는 모든 에셋과 연결된 메타데이터의 일부이기도 합니다.)

에디터는 어셈블리 정의 인스펙터에 **Use GUIDs** 옵션을 표시합니다. 이 옵션은 연결된 JSON 파일에 직렬화되지 않습니다. 대신 파일에 있는 레퍼런스 형식에서 선택 항목을 유추합니다.

\[다른 어셈블리 참조]를 참조하십시오.

GUID 사용:

```yml
"references": [
        "GUID:17b36165d09634a48bf5a0e4bb27f4bd",
        "GUID:b470eee7144904e59a1064b70fa1b086",
        "GUID:2bafac87e7f4b9b418d9448d219b01ab",
        "GUID:27619889b8ba8c24980f49ee34dbb44a",
        "GUID:0acc523941302664db1f4e527237feb3"
]
```

어셈블리 이름 사용:

```yml
"references": [
        "Unity.CollabProxy.Editor",
        "AssemblyB",
        "UnityEngine.UI",
        "UnityEngine.TestRunner",
        "UnityEditor.TestRunner"
]
```

#### versionDefines object\[]

선택 사항이며, 각 버전 정의에 대한 오브젝트를 포함합니다. 이 오브젝트에는 세 가지 필드가 있습니다.

* name:string -- 리소스 이름
* expression:string -- 리소스의 버전 또는 버전의 범위를 정의하는 표현식
* define:string -- 정의할 심볼

\[버전 정의]를 참조하십시오.

```yml
"versionDefines": [
    {
        "name": "com.unity.ide.vscode",
        "expression": "[1.7,2.4.1]",
        "define": "MY_SYMBOL"
    },
    {
        "name": "com.unity.test-framework",
        "expression": "[2.7.2-preview.8]",
        "define": "TESTS"
    }
]
```

### 예시 어셈블리 정의 JSON 문자열##example-with-assembly-names-and-included-platforms

다른 어셈블리 정의 및 *includePlatforms*에 대한 레퍼런스에 어셈블리 이름 사용:

```yml
{
    "name": "BeeAssembly",
    "references": [
        "Unity.CollabProxy.Editor",
        "AssemblyB",
        "UnityEngine.UI",
        "UnityEngine.TestRunner",
        "UnityEditor.TestRunner"
    ],
    "includePlatforms": [
        "Android",
        "LinuxStandalone64",
        "WebGL"
    ],
    "excludePlatforms": [],
    "overrideReferences": true,
    "precompiledReferences": [
        "Newtonsoft.Json.dll",
        "nunit.framework.dll"
    ],
    "autoReferenced": false,
    "defineConstraints": [
        "UNITY_2019",
        "UNITY_INCLUDE_TESTS"
    ],
    "versionDefines": [
        {
            "name": "com.unity.ide.vscode",
            "expression": "[1.7,2.4.1]",
            "define": "MY_SYMBOL"
        },
        {
            "name": "com.unity.test-framework",
            "expression": "[2.7.2-preview.8]",
            "define": "TESTS"
        }
    ],
    "noEngineReferences": false
}
```

다른 어셈블리 정의 및 *excludePlatforms*에 대한 레퍼런스에 GUID 사용:

```yml
{
    "name": "BeeAssembly",
    "references": [
        "GUID:17b36165d09634a48bf5a0e4bb27f4bd",
        "GUID:b470eee7144904e59a1064b70fa1b086",
        "GUID:2bafac87e7f4b9b418d9448d219b01ab",
        "GUID:27619889b8ba8c24980f49ee34dbb44a",
        "GUID:0acc523941302664db1f4e527237feb3"
    ],
    "includePlatforms": [],
    "excludePlatforms": [
        "iOS",
        "macOSStandalone",
        "tvOS"
    ],
    "allowUnsafeCode": false,
    "overrideReferences": true,
    "precompiledReferences": [
        "Newtonsoft.Json.dll",
        "nunit.framework.dll"
    ],
    "autoReferenced": false,
    "defineConstraints": [
        "UNITY_2019",
        "UNITY_INCLUDE_TESTS"
    ],
    "versionDefines": [
        {
            "name": "com.unity.ide.vscode",
            "expression": "[1.7,2.4.1]",
            "define": "MY_SYMBOL"
        },
        {
            "name": "com.unity.test-framework",
            "expression": "[2.7.2-preview.8]",
            "define": "TESTS"
        }
    ],
    "noEngineReferences": false
}
```

## 어셈블리 정의 레퍼런스 JSON##assembly-definition-reference-json

어셈블리 정의 레퍼런스는 다음 필드가 포함된 JSON 객체입니다.

#### 레퍼런스 문자열

필수입니다. 참조할 어셈블리 정의입니다. \[어셈블리 정의 레퍼런스]를 참조하십시오.

어셈블리의 이름 또는 에셋의 GUID를 사용하여 어셈블리 정의 에셋을 참조할 수 있습니다. [AssetDatabase.AssetPathToGUID](/engine/6000.0/script-reference/unity-editor/asset-database/asset-path-to-guid.md) 함수를 사용하여 에셋의 GUID를 검색해서 가져올 수 있습니다 (GUID는 모든 에셋과 연결된 메타데이터의 일부이기도 합니다.)

어셈블리 이름 사용:

```yml
{
    "reference": "AssemblyA"
}
```

어셈블리 정의 에셋 GUID 사용

```yml
{
    "reference": "GUID:f4de40948f4904ecb94b59dd38aab8a1"
}
```

\[어셈블리 정의 레퍼런스 에셋 생성]을 참조하십시오.

{ /*  Start_links  */ }

{ /*  End_links  */ }
