Gradle 템플릿은 Gradle을 사용하여 Android 애플리케이션을 빌드하는 방법을 설정합니다. 각 Gradle 템플릿은 단일 Gradle 프로젝트를 나타냅니다. Gradle 프로젝트는 다른 Gradle 프로젝트를 포함하고 이에 의존할 수 있습니다.
Gradle 템플릿은 다음의 파일로 구성됩니다.
File | 위치 | 내용물 |
---|---|---|
baseProjectTemplate.gradle |
익스포트한 프로젝트의 root/build.gradle 폴더 |
최종 Gradle 프로젝트의 모든 모듈에 영향을 미치는 설정 정보가 있습니다. 사용할 Android Gradle 플러그인 버전과 Java 플러그인의 위치를 지정합니다. 이 위치는 프로젝트 내부의 온라인 저장소와 Java 플러그인을 조합하여 지정합니다. |
launcherTemplate.gradle |
익스포트한 프로젝트의 root/launcher/build.gradle 폴더 |
Android 애플리케이션을 빌드하는 방법에 대한 명령어가 있습니다. 여기에는 번들링, 서명, APK를 나누는지 여부가 포함됩니다. unityLibrary 프로젝트에 따라 다르며 .apk 파일이나 앱 번들을 출력합니다. |
mainTemplate.gradle |
익스포트한 프로젝트의 root/unityLibrary/build.gradle 폴더 |
Unity를 라이브러리로 빌드하는 방법에 대한 명령어가 있습니다.이는 .aar 파일을 출력합니다.Unity 에디터의 커스텀 템플릿으로 Unity 템플릿을 오버라이드할 수 있습니다.자세한 내용은 이 페이지의 커스텀 Gradle 빌드 템플릿 제공 섹션을 참조하십시오. |
libTemplate.gradle |
다양함 |
Android 라이브러리 프로젝트 플러그인에 build.gradle 파일이 포함되어 있지 않은 경우 Unity는 파일을 생성하기 위해 libTemplate.gradle 파일을 템플릿으로 사용합니다. Unity가 build.gradle 파일을 생성한 후 또는 플러그인 디렉토리에 이미 파일이 존재하는 경우 Unity는 플러그인을 Gradle 프로젝트에 복사합니다. |
settingsTemplate.gradle |
익스포트한 프로젝트의 root/settings.gradle 파일 |
프로젝트를 빌드할 때 Gradle 빌드 시스템이 포함해야 하는 모듈 이름을 지정합니다.Unity 에디터의 커스텀 템플릿으로 Unity 템플릿을 오버라이드할 수 있습니다.자세한 내용은 이 페이지의 커스텀 Gradle 빌드 템플릿 제공 섹션을 참조하십시오. |
gradleTemplate.properties |
익스포트한 프로젝트의 root/gradle.properties 파일 |
Gradle 빌드 시스템을 설정하고 Java 가상 머신(JVM) 힙의 크기와 같은 속성을 지정합니다. |
Unity가 생성하는 Gradle 프로젝트 파일을 보다 효과적으로 제어하려면 Unity의 기본 Gradle 템플릿 파일을 오버라이드하면 됩니다. 이렇게 하는 방법에 대한 내용은 Gradle 템플릿 파일로 Gradle 프로젝트 파일 수정을 참조하십시오.
Unity에서 조합된 Gradle 프로젝트를 수정하려면 AndroidProjectFilesModifier 추상 클래스에서 OnModifyAndroidProjectFiles 메서드를 구현하는 클래스를 생성합니다. 이 메서드는 Gradle 프로젝트 파일을 나타내는 C# 오브젝트를 수신합니다. Android 프로젝트 설정 관리자에 대한 자세한 내용은 Android 프로젝트 설정 관리자로 Gradle 프로젝트 파일 수정을 참조하십시오.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.