Uploaded image for project: 'Gradle'
  1. Gradle
  2. GRADLE-948

Archive Task does not support type field

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 0.9
    • Fix Version/s: 0.9-rc-1

      Description

      when creating a new jar type task I want to be able to set the type to 'source'
      eg:
      task jarSource(type: Jar){
      ...
      type = 'source'
      classifier = 'src'
      }

      and then publish using ivy pattern <somedir>/[organization]/[module]/[type]s/[artifact](-[classifier]).[ext]

      Currently this does not give expected result (that is type substituted in pattern is actually value of extension) -> both source and classes jar is put into folder .../jars/*.jar

      Suggested fix:
      add type field in class org.gradle.api.tasks.bundling.AbstractArchiveTask
      then change method getType in org.gradle.api.internal.artifacts.publish.ArchivePublishArtifact to use this field instead of extension eg (note it is probably worth though to clean up the following code snippet
      public String getType() {
      if (archiveTask.getType() != null && !archiveTask.getType().equals(""))
      return archiveTask.getType();
      else
      return archiveTask.getExtension();
      }

      I would be highly appreciated to include this simple fix in version 0.9 release.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              hans_d Hans Dockter
              Reporter:
              gretarrafn Gretar Rafn Arnason
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: