Class SizeSpec

java.lang.Object
dev.gmitch215.bytebox.gradle.SizeSpec

public abstract class SizeSpec extends Object
The size { } block: how the compiled module is packed, and how big it may get.
Since:
1.0.0
  • Constructor Details

    • SizeSpec

      public SizeSpec()
  • Method Details

    • getModule

      public abstract org.gradle.api.provider.Property<SizeSpec.ModuleType> getModule()
      Returns how the compiled module is carried in the bundle.
      Returns:
      how the compiled module is carried in the bundle
    • getCompression

      @Deprecated(since="1.0.1", forRemoval=true) public abstract org.gradle.api.provider.Property<SizeSpec.Compressor> getCompression()
      Deprecated, for removal: This API element is subject to removal in a future version.
      nothing reads this. Cloudflare removed the compressed size limit on 2026-09-04, so pre-compression trades startup time for bundle bytes that are no longer metered.
      Returns which compressor packs the module.
      Returns:
      which compressor packs the module
    • getCompressionLevel

      @Deprecated(since="1.0.1", forRemoval=true) public abstract org.gradle.api.provider.Property<Integer> getCompressionLevel()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the compression level, passed through to the chosen compressor.
      Returns:
      the compression level, passed through to the chosen compressor
    • getCompressionArgs

      @Deprecated(since="1.0.1", forRemoval=true) public abstract org.gradle.api.provider.ListProperty<String> getCompressionArgs()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns extra arguments for the chosen compressor.
      Returns:
      extra arguments for the chosen compressor
    • getBudget

      public abstract org.gradle.api.provider.Property<String> getBudget()
      Returns a ceiling the build fails past, measured on the uncompressed module.

      Takes a plain byte count or a suffixed size: 250KiB, 3MB, 1MiB. Cloudflare accepts 64 MiB uncompressed on either plan and meters nothing else, so a budget is not there to keep a Java Worker deployable. It is there to fail the build when the compiled module grows, because compiling it is what spends the one second a Worker has to reach its first request. This measures the module, which is code; bundle bytes that are not code cost startup nothing.

      Returns:
      a ceiling the build fails past, measured on the uncompressed module
    • compressionArgs

      @Deprecated(since="1.0.1", forRemoval=true) public void compressionArgs(String... args)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds compressor arguments.
      Parameters:
      args - the arguments
    • budgetBytes

      public long budgetBytes()
      The budget in bytes, or -1 when none is set.
      Returns:
      the ceiling