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

      public abstract org.gradle.api.provider.Property<SizeSpec.Compressor> getCompression()
      Returns which compressor packs the module.
      Returns:
      which compressor packs the module
    • getCompressionLevel

      public abstract org.gradle.api.provider.Property<Integer> getCompressionLevel()
      Returns the compression level, passed through to the chosen compressor.
      Returns:
      the compression level, passed through to the chosen compressor
    • getCompressionArgs

      public abstract org.gradle.api.provider.ListProperty<String> getCompressionArgs()
      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 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

      public void compressionArgs(String... args)
      Adds compressor arguments.
      Parameters:
      args - the arguments
    • budgetBytes

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