Skip to content

Commit 9276be5

Browse files
committed
resolves #313 restore ue4-engine image
Also, drop deprecated for more than a year `--no-full`/`--no-minimal` options and just use `--target`.
1 parent a6fd311 commit 9276be5

File tree

6 files changed

+70
-62
lines changed

6 files changed

+70
-62
lines changed

docs/ue4-docker-build.adoc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,6 @@ Monitor resource usage during builds (useful for debugging)
8787
*--no-cache*::
8888
Disable Docker build cache
8989

90-
*--no-full*::
91-
Don't build the ue4-full image (deprecated, use *--target* _target_ instead)
92-
93-
*--no-minimal*::
94-
Don't build the ue4-minimal image (deprecated, use *--target* _target_ instead)
95-
9690
*--opt* _opt_::
9791
Set an advanced configuration option (can be specified multiple times to specify multiple options)
9892

@@ -111,9 +105,11 @@ Add a suffix to the tags of the built images
111105
*--target* _target_::
112106
Tells ue4-docker to build specific image (including its dependencies).
113107
+
114-
Supported values: `all`, `build-prerequisites`, `full`, `minimal`, `source`.
108+
Supported values: `all`, `build-prerequisites`, `full`, `minimal`, `source`, `engine`.
115109
+
116110
You can specify the `--target` option multiple times.
111+
+
112+
Defaults to `minimal`.
117113

118114
*-ue4cli* _ue4cli_::
119115
Override the default version of ue4cli installed in the ue4-full image

src/ue4docker/build.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,12 +439,21 @@ def build():
439439
else:
440440
logger.info("Skipping ue4-source image build.")
441441

442-
if config.buildTargets["minimal"]:
442+
if config.buildTargets["minimal"] or config.buildTargets["engine"]:
443443
ue4BuildArgs = prereqConsumerArgs + [
444444
"--build-arg",
445445
"TAG={}".format(mainTags[1]),
446446
]
447447

448+
# Build the UE4 Engine source build image, unless requested otherwise by the user
449+
if config.buildTargets["engine"]:
450+
builder.build_builtin_image(
451+
"ue4-engine",
452+
mainTags,
453+
commonArgs + config.platformArgs + ue4BuildArgs,
454+
)
455+
builtImages.append("ue4-engine")
456+
448457
# Build the minimal UE4 CI image, unless requested otherwise by the user
449458
if config.buildTargets["minimal"]:
450459
minimalArgs = (

src/ue4docker/clean.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def clean():
2828
"-tag", default=None, help="Only clean images with the specified tag"
2929
)
3030
parser.add_argument("--source", action="store_true", help="Clean ue4-source images")
31+
parser.add_argument("--engine", action="store_true", help="Clean ue4-engine images")
3132
parser.add_argument(
3233
"--all", action="store_true", help="Clean all ue4-docker images"
3334
)
@@ -52,25 +53,34 @@ def clean():
5253
cleaner.cleanMultiple(dangling, args.dry_run)
5354

5455
# If requested, remove ue4-source images
55-
if args.source == True:
56+
if args.source:
5657
_cleanMatching(
5758
cleaner,
5859
GlobalConfiguration.resolveTag("ue4-source"),
5960
args.tag,
6061
args.dry_run,
6162
)
6263

64+
# If requested, remove ue4-engine images
65+
if args.engine:
66+
_cleanMatching(
67+
cleaner,
68+
GlobalConfiguration.resolveTag("ue4-engine"),
69+
args.tag,
70+
args.dry_run,
71+
)
72+
6373
# If requested, remove everything
64-
if args.all == True:
74+
if args.all:
6575
_cleanMatching(
6676
cleaner, GlobalConfiguration.resolveTag("ue4-*"), args.tag, args.dry_run
6777
)
6878

6979
# If requested, run `docker system prune`
70-
if args.prune == True:
80+
if args.prune:
7181
logger.action("Running `docker system prune`...")
7282
pruneCommand = ["docker", "system", "prune", "-f"]
73-
if args.dry_run == True:
83+
if args.dry_run:
7484
print(pruneCommand)
7585
else:
7686
subprocess.call(pruneCommand)

src/ue4docker/infrastructure/BuildConfiguration.py

Lines changed: 11 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -125,23 +125,14 @@ def addArguments(parser):
125125
action="store_true",
126126
help="Print `docker build` commands instead of running them",
127127
)
128-
parser.add_argument(
129-
"--no-minimal",
130-
action="store_true",
131-
help="Don't build the ue4-minimal image (deprecated, use --target instead)",
132-
)
133-
parser.add_argument(
134-
"--no-full",
135-
action="store_true",
136-
help="Don't build the ue4-full image (deprecated, use --target instead)",
137-
)
138128
parser.add_argument(
139129
"--no-cache", action="store_true", help="Disable Docker build cache"
140130
)
141131
parser.add_argument(
142132
"--target",
143133
action="append",
144-
help="Add a target to the build list. Valid targets are `build-prerequisites`, `source`, `engine`, `minimal`, `full`, and `all`. May be specified multiple times or comma-separated. Defaults to `all`.",
134+
default=[],
135+
help="Add a target to the build list. Valid targets are `build-prerequisites`, `source`, `engine`, `minimal`, `full`, and `all`. May be specified multiple times or comma-separated. Defaults to `minimal`.",
145136
)
146137
parser.add_argument(
147138
"--random-memory",
@@ -282,47 +273,12 @@ def __init__(self, parser, argv, logger):
282273
self.args = parser.parse_args(argv)
283274
self.changelist = self.args.changelist
284275

285-
# Figure out what targets we have; this is needed to find out if we need --ue-version.
286-
using_target_specifier_old = self.args.no_minimal or self.args.no_full
287-
using_target_specifier_new = self.args.target is not None
288-
289-
# If we specified nothing, it's the same as specifying `minimal`
290-
if not using_target_specifier_old and not using_target_specifier_new:
276+
if len(self.args.target) <= 0:
291277
self.args.target = ["minimal"]
292-
elif using_target_specifier_old and not using_target_specifier_new:
293-
# Convert these to the new style
294-
logger.warning(
295-
"Using deprecated `--no-*` target specifiers; recommend changing to `--target`",
296-
False,
297-
)
298-
299-
# no-minimal implies no-full
300-
if self.args.no_minimal:
301-
self.args.no_full = True
302278

303-
# Change into target descriptors
304-
self.args.target = []
305-
306-
if not self.args.no_full:
307-
self.args.target += ["full"]
308-
309-
if not self.args.no_minimal:
310-
self.args.target += ["minimal"]
311-
312-
# disabling these was never supported
313-
self.args.target += ["source"]
314-
self.args.target += ["build-prerequisites"]
315-
316-
elif using_target_specifier_new and not using_target_specifier_old:
317-
# these can be token-delimited, so let's just split them apart and then remerge them into one list
318-
split = [item.split(",") for item in self.args.target]
319-
self.args.target = [item for sublist in split for item in sublist]
320-
321-
elif using_target_specifier_old and using_target_specifier_new:
322-
# uhoh
323-
raise RuntimeError(
324-
"specified both `--target` and the old `--no-*` options; please use only `--target`!"
325-
)
279+
# these can be token-delimited, so let's just split them apart and then remerge them into one list
280+
split_target = [item.split(",") for item in self.args.target]
281+
self.args.target = [item for sublist in split_target for item in sublist]
326282

327283
# Now that we have our options in `self.args.target`, evaluate our dependencies
328284
# In a theoretical ideal world this should be code-driven; if you find yourself adding a lot more code to this, consider a redesign!
@@ -336,6 +292,7 @@ def __init__(self, parser, argv, logger):
336292
self.buildTargets = {
337293
"build-prerequisites": False,
338294
"source": False,
295+
"engine": False,
339296
"minimal": False,
340297
"full": False,
341298
}
@@ -355,6 +312,10 @@ def __init__(self, parser, argv, logger):
355312
self.buildTargets["minimal"] = True
356313
active_targets.add("source")
357314

315+
if "engine" in active_targets or "all" in active_targets:
316+
self.buildTargets["engine"] = True
317+
active_targets.add("source")
318+
358319
if "source" in active_targets or "all" in active_targets:
359320
self.buildTargets["source"] = True
360321
active_targets.add("build-prerequisites")
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{% if combine %}
2+
FROM source as engine
3+
{% else %}
4+
ARG NAMESPACE
5+
ARG TAG
6+
ARG PREREQS_TAG
7+
FROM ${NAMESPACE}/ue4-source:${TAG}-${PREREQS_TAG}
8+
{% endif %}
9+
10+
# Build UBT and build the Engine
11+
# TODO: Fix UE4 compatibility
12+
RUN ./Engine/Build/BatchFiles/Linux/Build.sh UE4Editor Linux Development -WaitMutex
13+
RUN ./Engine/Build/BatchFiles/Linux/Build.sh UnrealEditor Linux Development -WaitMutex
14+
RUN ./Engine/Build/BatchFiles/Linux/Build.sh ShaderCompileWorker Linux Development -WaitMutex
15+
RUN ./Engine/Build/BatchFiles/Linux/Build.sh UnrealPak Linux Development -WaitMutex
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# escape=`
2+
{% if combine %}
3+
FROM source as engine
4+
{% else %}
5+
ARG NAMESPACE
6+
ARG TAG
7+
ARG PREREQS_TAG
8+
FROM ${NAMESPACE}/ue4-source:${TAG}-${PREREQS_TAG}
9+
{% endif %}
10+
11+
# Build UBT and build the Engine
12+
RUN GenerateProjectFiles.bat
13+
# TODO: Fix UE4 compatibility
14+
# RUN .\Engine\Build\BatchFiles\Build.bat UE4Editor Win64 Development -WaitMutex
15+
RUN .\Engine\Build\BatchFiles\Build.bat UnrealEditor Win64 Development -WaitMutex
16+
RUN .\Engine\Build\BatchFiles\Build.bat ShaderCompileWorker Win64 Development -WaitMutex
17+
RUN .\Engine\Build\BatchFiles\Build.bat UnrealPak Win64 Development -WaitMutex

0 commit comments

Comments
 (0)