Class PackageJsonExtension
-
- All Implemented Interfaces:
-
java.io.Serializable
public class PackageJsonExtension implements Serializable
The package json extension facility.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classPackageJsonExtension.DependencyBuilderA dependency builder for package dependencies.
public final classPackageJsonExtension.NpmTaskDependencyA script dependency for package scripts.
taskName The name of the script. projectName The name of the project in which the script is defined.
public final classPackageJsonExtension.NpmScriptA package script.
scriptName The name of the script. command The command to run. taskDependencies The dependencies of the script. configureTask The task configuration.
public final classPackageJsonExtension.ScriptBuilderA script builder for package scripts.
-
Field Summary
Fields Modifier and Type Field Description private final Property<String>nameprivate final Property<String>versionprivate final Property<String>authorprivate final Property<String>descriptionprivate final Property<String>mainprivate final Property<String>typeprivate final Property<String>licenseprivate final ListProperty<PackageJsonExtension.NpmScript>scriptsprivate final ListProperty<Pair<String, String>>dependenciesprivate final ListProperty<Pair<String, String>>devDependenciesprivate final Property<Pair<String, String>>repositoryprivate final Property<String>homepage
-
Constructor Summary
Constructors Constructor Description PackageJsonExtension(Project project)
-
Method Summary
Modifier and Type Method Description final Property<String>getName()The name of the package. final Property<String>getVersion()The version of the package. final Property<String>getAuthor()The author of the package. final Property<String>getDescription()The description of the package. final Property<String>getMain()The main file of the package. final Property<String>getType()The type of package. final Property<String>getLicense()The license of the package. final ListProperty<PackageJsonExtension.NpmScript>getScripts()The scripts of the package. final ListProperty<Pair<String, String>>getDependencies()The dependencies of the package. final ListProperty<Pair<String, String>>getDevDependencies()The dev dependencies of the package. final Property<Pair<String, String>>getRepository()The repository of the package. final Property<String>getHomepage()The homepage of the package. final Unitdependencies(Function1<PackageJsonExtension.DependencyBuilder, Unit> apply)Add a dependency to the package. final UnitdevDependencies(Function1<PackageJsonExtension.DependencyBuilder, Unit> apply)Add a dev dependency to the package. final Unitscripts(Function1<PackageJsonExtension.ScriptBuilder, Unit> apply)Add a script to the package. -
-
Method Detail
-
getVersion
final Property<String> getVersion()
The version of the package.
-
getDescription
final Property<String> getDescription()
The description of the package.
-
getLicense
final Property<String> getLicense()
The license of the package.
-
getScripts
final ListProperty<PackageJsonExtension.NpmScript> getScripts()
The scripts of the package.
-
getDependencies
final ListProperty<Pair<String, String>> getDependencies()
The dependencies of the package.
-
getDevDependencies
final ListProperty<Pair<String, String>> getDevDependencies()
The dev dependencies of the package.
-
getRepository
final Property<Pair<String, String>> getRepository()
The repository of the package.
-
getHomepage
final Property<String> getHomepage()
The homepage of the package.
-
dependencies
final Unit dependencies(Function1<PackageJsonExtension.DependencyBuilder, Unit> apply)
Add a dependency to the package.
-
devDependencies
final Unit devDependencies(Function1<PackageJsonExtension.DependencyBuilder, Unit> apply)
Add a dev dependency to the package.
-
scripts
final Unit scripts(Function1<PackageJsonExtension.ScriptBuilder, Unit> apply)
Add a script to the package.
-
-
-
-