Uploaded image for project: 'ShrinkWrap'
  1. ShrinkWrap
  2. SHRINKWRAP-163

Make archive name optional in ShrinkWrap#create()

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Major Major
    • 1.0.0-alpha-10
    • 1.0.0-alpha-9
    • api
    • None

      Make the Archive type first in the API, as it allows us to introduce defaults for the name and even introduce an extension constant.

      ShrinkWrap.create(Class<T> type)
      ShrinkWrap.create(Class<T> type, String name)

      ShrinkWrap.create(Class<T> type, ExtensionType ext) ***maybe
      ShrinkWrap.create(Class<T> type, String name, ExtensionType ext) ***maybe

      For the simplest case (Weld SE Arquillian tests for instance), the name would be defaulted.

      ShrinkWrap.create(JavaArchive.class)

      The current usage would be flipped

      ShrinkWrap.create(JavaArchive.class, "test.jar")

      We could consider getting rid of the string-based extension classifier

      ShrinkWrap.create(JavaArchive.class, "test", JAR)

      Or, if you wanted to specify just an extension (for instance to create a WAR), you could do:

      ShrinkWrap.create(JavaArchive.class, WAR)

      To take another angle, maybe the extension can be implied based on the archive type:

      JavaArchive = ".jar"
      EnterpriseArchive = ".ear"
      WebArchive = ".war"

      In that case, we can just get back to:

      ShrinkWrap.create(WebArchive.class)

        1. SHRINKWRAP-163.patch
          17 kB
        2. SHRINKWRAP-163-v1.txt
          23 kB
        3. SHRINKWRAP-163-v3.patch
          23 kB
        4. SHRINKWRAP-163-v4.patch
          12 kB

            kenglxn Ken Gullaksen (Inactive)
            dan.j.allen Dan Allen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: