Package dev.gmitch215.bytebox.gradle
Class SizeSpec
java.lang.Object
dev.gmitch215.bytebox.gradle.SizeSpec
The
size { } block: how the compiled module is packed, and how big it may get.- Since:
- 1.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhich compressor packs the module.static enumHow the compiled module is carried in the bundle. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongThe budget in bytes, or -1 when none is set.voidcompressionArgs(String... args) Adds compressor arguments.abstract org.gradle.api.provider.Property<String> Returns a ceiling the build fails past, measured on Wrangler's gzip meter.abstract org.gradle.api.provider.Property<SizeSpec.Compressor> Returns which compressor packs the module.abstract org.gradle.api.provider.ListProperty<String> Returns extra arguments for the chosen compressor.abstract org.gradle.api.provider.Property<Integer> Returns the compression level, passed through to the chosen compressor.abstract org.gradle.api.provider.Property<SizeSpec.ModuleType> Returns how the compiled module is carried in the bundle.
-
Constructor Details
-
SizeSpec
public SizeSpec()
-
-
Method Details
-
getModule
Returns how the compiled module is carried in the bundle.- Returns:
- how the compiled module is carried in the bundle
-
getCompression
Returns which compressor packs the module.- Returns:
- which compressor packs the module
-
getCompressionLevel
Returns the compression level, passed through to the chosen compressor.- Returns:
- the compression level, passed through to the chosen compressor
-
getCompressionArgs
Returns extra arguments for the chosen compressor.- Returns:
- extra arguments for the chosen compressor
-
getBudget
Returns a ceiling the build fails past, measured on Wrangler's gzip meter.Takes a plain byte count or a suffixed size:
250KiB,3MB,1MiB. Cloudflare enforces 3 MB on the free plan and 10 MB on paid, after its own gzip, so a budget is for noticing a regression long before the platform does.- Returns:
- a ceiling the build fails past, measured on Wrangler's gzip meter
-
compressionArgs
Adds compressor arguments.- Parameters:
args- the arguments
-
budgetBytes
public long budgetBytes()The budget in bytes, or -1 when none is set.- Returns:
- the ceiling
-