This translation is community contributed and may not be up to date. We only maintain the English version of the documentation. Read this manual in English
Bob은 일반적인 에디터 워크플로우 밖에서 Defold 프로젝트를 빌드하기 위한 커맨드 라인 도구입니다.
Bob은 데이터 빌드(에디터 메뉴 항목 Project ▸ Build를 선택하는 빌드 단계에 해당), 데이터 아카이브 생성, 그리고 독립 실행 및 배포 가능한 어플리케이션 번들 생성(에디터 메뉴 항목 Project ▸ Bundle ▸ ... 옵션에 해당)을 할 수 있습니다.
Bob은 빌드에 필요한 모든 것을 포함하는 Java JAR 아카이브로 배포됩니다. 최신 bob.jar 배포본은 GitHub Releases 페이지에서 찾을 수 있습니다. 릴리스를 선택한 다음 bob/bob.jar를 다운로드하세요. 실행하려면 OpenJDK 25가 필요합니다.
호환되는 OpenJDK 25 미러:
Windows를 사용한다면 OpenJDK용 .msi 파일 설치 관리자를 사용하면 됩니다.
Bob은 쉘이나 커맨드 라인에서 java(Windows에서는 java.exe)를 호출하고 bob Java 아카이브를 인자로 제공하여 실행합니다.
$ java -jar bob.jar --help
usage: bob [options] [commands]
-a,--archive DEPRECATED! Accepted and ignored
--all-packages Build or bundle Base and all
external packages
-ar,--architectures <arg> Comma separated list of
architectures to include for the
platform
--archive-resource-padding <arg> The alignment of the resources in
the game archive. Default is 4
-bf,--bundle-format <arg> Which formats to create the
application bundle in. Comma
separated list. (Android: 'apk'
and 'aab')
--binary-output <arg> Location where built engine
binary will be placed. Default is
"<build-output>/<platform>/"
-bo,--bundle-output <arg> Bundle output directory
-br,--build-report <arg> DEPRECATED! Use
--build-report-json instead
-brhtml,--build-report-html <arg> Filepath where to save a build
report as HTML
-brjson,--build-report-json <arg> Filepath where to save a build
report as JSON
--bundle-report-html <arg> Filepath where to save a standalone
archive package report after bundling
--build-artifacts <arg> If left out, will default to
build the engine. Choices:
'engine', 'plugins', 'library'.
Comma separated list
--build-input <arg> Project resource path to build
instead of game.project. May be
specified more than once. More
than one occurrence is allowed
--build-input-file <arg> File containing project resource
paths to build instead of
game.project. May be specified
more than once. More than one
occurrence is allowed
--build-server <arg> The build server (when using
native extensions)
--build-server-header <arg> Additional build server header to
set. More than one occurrence is
allowed
-ce,--certificate <arg> DEPRECATED! Use --keystore
instead
-d,--debug DEPRECATED! Use --variant=debug
instead
--debug-ne-upload Outputs the files sent to build
server as upload.zip
--debug-output-glsl <arg> Force build GLSL shaders
--debug-output-hlsl <arg> Force build HLSL shaders
--debug-output-msl <arg> Force build Metal shaders
--debug-output-spirv <arg> Force build SPIR-V shaders
--debug-output-wgsl <arg> Force build WGSL shaders
--defoldsdk <arg> What version of the defold sdk
(sha1) to use
--download-size-report <arg> Filepath where to save the
estimated Google Play download
size as JSON (Android)
-e,--email <arg> User email
-ea,--exclude-archive Exclude resource archives from
application bundle. Use this to
create an empty Defold
application for use as a build
target
--exclude-build-folder <arg> DEPRECATED! Use '.defignore' file
instead
--experimental-path-minification Minimizes resource path names in
order to save bundle size.
-h,--help This help message
-i,--input <arg> DEPRECATED! Use --root instead
--identity <arg> Sign identity (iOS)
-kp,--key-pass <arg> Password of the deployment key if
different from the keystore
password (Android)
-ks,--keystore <arg> Deployment keystore used to sign
APKs (Android)
-ksa,--keystore-alias <arg> The alias of the signing key+cert
you want to use (Android)
-ksp,--keystore-pass <arg> Password of the deployment
keystore (Android)
-l,--liveupdate <arg> DEPRECATED! Use --all-packages or
--package instead
--max-cpu-threads <arg> Max count of threads that bob.jar
can use
-mp,--mobileprovisioning <arg> mobileprovisioning profile (iOS)
--ne-build-dir <arg> Specify a folder with includes or
source, to build a specific
library. More than one occurrence
is allowed
--ne-output-name <arg> Specify a library target name
-o,--output <arg> Output directory. Default is
"build/default"
--package <arg> Build or bundle a named package.
May be repeated
-p,--platform <arg> Platform (when building and
bundling)
-pk,--private-key <arg> DEPRECATED! Use --keystore
instead
-r,--root <arg> Build root directory. Default is
current directory
--resource-cache-local <arg> Path to local resource cache
--resource-cache-remote <arg> URL to remote resource cache
--resource-cache-remote-pass <arg> Password/token to authenticate
access to the remote resource
cache
--resource-cache-remote-user <arg> Username to authenticate access
to the remote resource cache
--settings <arg> Path to a game project settings
file. The settings files are
applied left to right. More than
one occurrence is allowed
--strip-executable Strip the dmengine of debug
symbols (when bundling iOS or
Android)
-tc,--texture-compression Use texture compression as
specified in texture profiles
-tp,--texture-profiles <arg> DEPRECATED! Use
--texture-compression instead
-u,--auth <arg> User auth token
--use-async-build-server DEPRECATED! Asynchronous build is
now the default
--use-lua-bytecode-delta Use byte code delta compression
when building for multiple
architectures
--use-uncompressed-lua-source Use uncompressed and unencrypted
Lua source code instead of byte
code
--use-vanilla-lua DEPRECATED! Use
--use-uncompressed-lua-source
instead
-v,--verbose Verbose output
--variant <arg> Specify debug, release or
headless version of dmengine
(when bundling)
--version Prints the version number to the
output
--with-sha1 Generate (and verify) sha1
signatures from build artifacts
(when bunding for web)
--with-symbols Generate the symbol file (if
applicable)
--texture-compression은 값을 받지 않는 스위치입니다. 텍스쳐 프로파일에서 선택한 압축을 활성화하려면 포함하고, 텍스쳐 압축을 비활성화하려면 생략하세요. 이전 형식인 --texture-compression=true도 계속 허용됩니다. 이전 형식인 --texture-compression=false는 무시되고 경고가 표시되므로, 대신 스위치를 생략하세요.
사용 가능한 명령:
cleandistcleanbuildgame.graph.json으로 저장합니다. 기본 루트는 game.project입니다. 다른 루트를 지정하려면 --build-input이나 --build-input-file을 사용합니다. 아카이브 메니페스트를 사용하면 패키지 규칙으로도 리소스를 선택할 수 있습니다. build 명령은 bundle에서 아카이브에 담을 리소스를 컴파일합니다.bundle--platform으로 지정합니다. Bob은 프로젝트 제목을 어플리케이션 이름으로 사용하고 빌드 출력 디렉터리 또는 --bundle-output으로 지정한 디렉터리에 저장합니다. 기본 엔진 변형은 release입니다. 디버그 실행 파일은 --variant debug로, 컨텐츠가 없는 어플리케이션은 --exclude-archive로 생성합니다.resolve사용 가능한 플랫폼과 아키텍처:
x86_64-macosarm64-macosx86_64-win32x86_64-linuxarm64-linuxarm64_sim-ios--identity와 --mobileprovisioning은 무시됩니다.arm64-ios--architectures 인자 값은 arm64-ios입니다.armv7-androidarmv7-android, 64 bit arm64-android 및 64 bit x86_64-android 아키텍처가 있는 Android입니다. 기본적으로 --architectures 인자 값은 armv7-android,arm64-android입니다. x86_64-android 아키텍처는 선택적으로 추가할 수 있으며(주로 Android 에뮬레이터, ChromeOS, Windows Subsystem for Android에 유용함) 명시적으로 추가해야 합니다.wasm-webwasm-web 및 wasm_pthread-web 아키텍처가 있는 HTML5입니다. 기본적으로 --architectures 인자 값은 wasm-web입니다.기본적으로 Bob은 현재 디렉토리에서 프로젝트를 찾고, game.project에서 도달할 수 있는 리소스를 build/default에 빌드합니다. 참조되지 않은 리소스는 컴파일되지 않습니다. 코드가 런타임에 원시 파일을 경로로 로드한다면 Custom Resources 프로젝트 설정을 통해 포함하세요. 그 밖의 Defold 리소스는 빌드 루트에서 도달할 수 있는 참조가 필요합니다.
$ cd /Applications/Defold-beta/branches/14/4/main
$ java -jar bob.jar
100%
$
여러 명령을 함께 실행할 수도 있습니다. 다음 예제는 라이브러리 종속성을 해결하고 빌드 출력물을 정리한 뒤 리소스를 컴파일하여 macOS 어플리케이션을 번들링합니다.
java -jar bob.jar --platform x86_64-macos resolve distclean build bundle
명령을 별도의 프로세스나 CI 단계에서 실행할 때는 game.graph.json을 포함한 빌드 출력 디렉터리를 유지하세요. 두 명령에 같은 프로젝트, 빌드 출력 디렉터리, 플랫폼, 아키텍처, 빌드 변형, 컴파일러 설정을 사용해야 합니다. 번들링할 때 Bob은 현재 아카이브 메니페스트를 읽고 저장된 그래프를 사용합니다. 소스 에셋을 바꾸거나 메니페스트 규칙으로 그래프에 없던 리소스를 추가하면 빌드를 다시 실행하세요.
java -jar bob.jar --platform x86_64-linux build
java -jar bob.jar --platform x86_64-linux --bundle-output dist bundle
--experimental-path-minification을 사용할 때는 두 명령에 모두 지정하고 minified_paths.json을 빌드 출력물과 함께 보관하세요. Bob은 저장된 매핑을 검증하고 다시 빌드해야 할 때 알려줍니다.
build와 bundle을 따로 실행할 때는 같은 패키지를 선택하세요. 패키지를 정의하는 방법은 아카이브 메니페스트를 참고하세요.
| 선택 | 번들 출력 |
|---|---|
| 선택 플래그 없음 | 외부 패키지의 컨텐츠까지 Base에 포함한 독립 실행형 어플리케이션을 생성합니다. |
--all-packages |
분리한 Base를 담은 어플리케이션과 모든 외부 패키지를 생성합니다. |
--package base |
분리한 Base를 담은 어플리케이션만 생성합니다. 시작에 필요한 리소스는 Base에 남습니다. |
--package common --package halloween |
이름을 지정한 외부 패키지만 생성합니다. 어플리케이션도 필요하면 --package base를 추가하세요. |
--all-packages는 값을 받지 않습니다. 이 플래그를 단독으로 사용하거나 --package <name>을 반복하여 패키지를 선택하세요. --package는 --all-packages, --build-input, --build-input-file과 함께 사용할 수 없습니다. 선택적으로 빌드하면 나머지 컴파일 결과는 유지됩니다. 번들링하면 선택한 패키지를 다시 생성하고 나머지 패키지의 출력물은 유지합니다.
--archive(-a)는 사용 중단되어 무시됩니다. --liveupdate yes는 모든 패키지를 선택하고 --liveupdate no는 기본 선택을 유지합니다. 두 값 모두 사용 중단 경고를 표시합니다. 패키지를 명시적으로 선택하면 해당 선택이 우선합니다. 기존 Live Update 설정을 사용하는 프로젝트는 --package liveupdate로 외부 컨텐츠를 선택할 수 있습니다.
bundle과 함께 --bundle-report-html <file>을 사용하면 패키지 내용과 출력 크기를 확인할 수 있습니다. --build-report-html과 --build-report-json은 build 중에 컴파일한 리소스를 보고합니다. 빌드 및 번들 보고서를 참고하세요.
Bob은 배포본의 릴리스 채널에 따라 기본 네이티브 익스텐션 빌드 서버를 선택합니다:
| Bob 릴리스 채널 | 기본 빌드 서버 |
|---|---|
stable |
https://build.defold.com |
beta와 alpha를 포함한 그 밖의 모든 채널 |
https://build-stage.defold.com |
java -jar bob.jar --version을 실행하면 Bob 버전 및 빌드 정보와 함께 릴리스 채널이 표시됩니다. --variant 옵션은 엔진 빌드 variant를 제어하며 이 릴리스 채널을 변경하지 않습니다.
직접 호스팅하는 Extender 서버 등을 명시적으로 선택하려면 --build-server <url>을 전달하세요. 이 옵션은 모든 릴리스 채널에서 기본값을 재정의합니다.
Bob의 쉐이더 컴파일 파이프라인을 호출하는 도구에서 후속 컴파일러가 최종 쉐이더 바이너리를 생성한다면 HLSL 텍스트 출력을 선택할 수 있습니다. 이 옵션은 컴파일러 API에 있으며 Bob의 커맨드 라인 옵션으로는 지정할 수 없습니다. 기존 --debug-output-hlsl 플래그는 빌드의 HLSL 출력을 선택하며, 바이너리 대신 소스 텍스트를 출력하는 옵션은 아닙니다.
공통 컴파일러 팩토리에 ShaderCompilePipeline.Options를 전달하고 hLSLOutputMode를 설정합니다.
import com.dynamo.bob.Platform;
import com.dynamo.bob.pipeline.Shaderc;
import com.dynamo.bob.pipeline.ShaderCompilers;
import com.dynamo.bob.pipeline.shader.ShaderCompilePipeline;
ShaderCompilePipeline.Options options = new ShaderCompilePipeline.Options();
options.hLSLOutputMode = Shaderc.HLSLOutputMode.HLSL_OUTPUT_MODE_SOURCE;
var compiler = ShaderCompilers.GetCommonShaderCompiler(Platform.X86_64Win32, options);
반환된 컴파일러를 일반적인 쉐이더 빌드 과정에서 사용합니다. 기본값인 HLSL_OUTPUT_MODE_BINARY는 기존 HLSL 바이너리 컴파일 경로를 유지합니다. HLSL_OUTPUT_MODE_SOURCE는 바이너리 생성 단계를 건너뛰고 후속 컴파일에 사용할 HLSL 텍스트를 반환합니다. 공통 컴파일러에서 바이너리 루트 시그니처 생성도 건너뛰지만 버텍스와 프래그먼트 단계 간 인터페이스 정규화는 유지합니다. 이 옵션은 GLSL, MSL, WGSL, SPIR-V 출력에 영향을 주지 않습니다.
하위 수준 API를 사용하는 경우 Java에서는 Shaderc.ShaderCompilerOptions.hLSLOutputMode, C++에서는 dmShaderc::ShaderCompilerOptions::m_HLSLOutputMode를 설정합니다. 이 컴파일러 API는 엔진 및 빌드 도구의 일부로, 런타임 익스텐션 SDK와는 별개입니다. DX12 런타임이 요구하는 바이너리를 생성하려면 출력된 소스를 후속 단계에서 컴파일해야 합니다.
이 변경으로 추가된 인터페이스는 쉐이더 파이프라인 옵션과 네이티브 컴파일러 옵션을 참고하세요.