Class SourcesExtension

java.lang.Object
io.github.intisy.gradle.github.plugin.extension.SourcesExtension

public class SourcesExtension extends Object
Extension for declaring dependencies resolved from an arbitrary git host or a direct jar URL, as opposed to a GitHub release (see github { }).
 sources {
     git {
         url = "https://gitlab.com/me/lib.git"
         ref = "main"
         into = "implementation"
     }
     jar {
         url = "https://nexus.internal/libs/foo-1.0.jar"
         header "Authorization", "Bearer ${myToken}"
         sha256 = "..."
         into = "implementation"
     }
 }
 

Both git { } and jar { } are repeatable.

  • Constructor Details

    • SourcesExtension

      public SourcesExtension()
  • Method Details

    • getGitSources

      public List<GitSourceEntry> getGitSources()
      Returns:
      every declared git { } entry, in declaration order.
    • getJarSources

      public List<JarSourceEntry> getJarSources()
      Returns:
      every declared jar { } entry, in declaration order.
    • git

      public void git(org.gradle.api.Action<? super GitSourceEntry> action)
      Declares a git repository dependency, configured by the given Gradle action.
      Parameters:
      action - action that configures a GitSourceEntry.
    • git

      public void git(groovy.lang.Closure<?> closure)
      Declares a git repository dependency, configured by the given Groovy closure. Supports Gradle Groovy DSL usage: git { ... }
      Parameters:
      closure - closure that configures a GitSourceEntry.
    • jar

      public void jar(org.gradle.api.Action<? super JarSourceEntry> action)
      Declares a direct jar URL dependency, configured by the given Gradle action.
      Parameters:
      action - action that configures a JarSourceEntry.
    • jar

      public void jar(groovy.lang.Closure<?> closure)
      Declares a direct jar URL dependency, configured by the given Groovy closure. Supports Gradle Groovy DSL usage: jar { ... }
      Parameters:
      closure - closure that configures a JarSourceEntry.