Interface GolangDependency
-
- All Superinterfaces:
java.lang.Cloneable,org.gradle.api.artifacts.Dependency,GolangCloneable,java.io.Serializable
- All Known Subinterfaces:
NotationDependency,ResolvedDependency
- All Known Implementing Classes:
AbstractGolangDependency,AbstractNotationDependency,AbstractResolvedDependency,BazaarNotationDependency,GitNotationDependency,GogradleRootProject,LocalDirectoryDependency,MercurialNotationDependency,SvnNotationDependency,UnrecognizedNotationDependency,VcsNotationDependency,VcsResolvedDependency,VendorNotationDependency,VendorResolvedDependency
public interface GolangDependency extends org.gradle.api.artifacts.Dependency, java.io.Serializable, GolangCloneable
Represents a dependency package, for example, such as a specific version of golang/x/crypto or a local directory. Typically, the minimum dependency unit is repository root directory.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringALL_DESCENDANTSAll descendants files and directories.static java.lang.StringONLY_CURRENT_FILESOnly files located in repo root.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CacheScopegetCacheScope()Get cache scope of this dependency.java.lang.StringgetName()The dependency's import path, e.g., golang.org/x/crypto/cmd.GolangPackagegetPackage()Get the package this dependency stands for.java.util.Set<java.lang.String>getSubpackages()This dependencies sub packages.java.lang.StringgetVersion()An unique identifier to locate a dependency, e.g., git commit id.booleanisFirstLevel()A dependency is said to be "first-level" when it is defined in build.gradle or gogradle.lock of root project.ResolvedDependencyresolve(ResolveContext context)Resolve to a concrete dependency which can be located to a specific version of code.-
Methods inherited from interface org.gradle.api.artifacts.Dependency
because, contentEquals, copy, getGroup, getReason
-
Methods inherited from interface com.github.blindpirate.gogradle.core.GolangCloneable
clone
-
-
-
-
Field Detail
-
ALL_DESCENDANTS
static final java.lang.String ALL_DESCENDANTS
All descendants files and directories.- See Also:
- Constant Field Values
-
ONLY_CURRENT_FILES
static final java.lang.String ONLY_CURRENT_FILES
Only files located in repo root.- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
java.lang.String getName()
The dependency's import path, e.g., golang.org/x/crypto/cmd. However, currently we support golang.org/x/crypto (the root path) only.- Specified by:
getNamein interfaceorg.gradle.api.artifacts.Dependency- Returns:
- dependency's import path
-
getVersion
java.lang.String getVersion()
An unique identifier to locate a dependency, e.g., git commit id.- Specified by:
getVersionin interfaceorg.gradle.api.artifacts.Dependency- Returns:
- the version string
-
getPackage
GolangPackage getPackage()
Get the package this dependency stands for.- Returns:
- the package
- See Also:
GolangPackage
-
resolve
ResolvedDependency resolve(ResolveContext context)
Resolve to a concrete dependency which can be located to a specific version of code.- Parameters:
context- the resolve context- Returns:
- resolved dependency
-
isFirstLevel
boolean isFirstLevel()
A dependency is said to be "first-level" when it is defined in build.gradle or gogradle.lock of root project.- Returns:
trueif it is "first-level",falseotherwise.
-
getCacheScope
CacheScope getCacheScope()
Get cache scope of this dependency.- Returns:
- the cache scope
-
getSubpackages
java.util.Set<java.lang.String> getSubpackages()
This dependencies sub packages. A sub package is a string representing the relative path to the repo root. This concept is inspired by glide- Returns:
- the set of sub packages
-
-