Skip to content

Commit

Permalink
Move getLockfile getter to PaketPluginExtension
Browse files Browse the repository at this point in the history
Description
===========

Just a small refactor to keep the API clean. The paketUnity extension
implemented a new getter `getLockFile`. It makes more sense to move this
property to the base class/interface `PaketPluginExtension`.

Changes
=======

![IMPROVE] move `getLockFile` property to `PaketPluginExtension`
  • Loading branch information
Larusso committed Mar 12, 2018
1 parent 3a599e0 commit 7517f86
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
Expand Up @@ -182,6 +182,13 @@ interface PaketPluginExtension {
*/
File getPaketDependenciesFile()

/**
* Returns the {@link File} path to the {@code paket.lock} file in the project.
*
* @return a {@link File} path to the {@code paket.lock} file in the project.
*/
File getPaketLockFile()

/**
* Returns the content of {@code paket.dependencies} parsed as {@link PaketDependencies} object.
*
Expand Down
Expand Up @@ -32,6 +32,7 @@ class DefaultPaketPluginExtension implements PaketPluginExtension {

private static final String DEFAULT_VERSION = ""
private static final String DEFAULT_MONO_EXECUTABLE = "mono"
private static final String DEFAULT_PAKET_LOCK_FILE_NAME = "paket.lock"

protected Project project
protected File customPaketDirectory
Expand Down Expand Up @@ -167,4 +168,9 @@ class DefaultPaketPluginExtension implements PaketPluginExtension {
protected String getBootstrapperExecutableName() {
DEFAULT_PAKET_BOOTSTRAPPER_EXECUTION_NAME
}

@Override
File getPaketLockFile() {
return new File(project.projectDir, DEFAULT_PAKET_LOCK_FILE_NAME)
}
}
Expand Up @@ -25,9 +25,4 @@ interface PaketUnityPluginExtension extends PaketPluginExtension {
* @param directory name of the output directory
*/
void setPaketOutputDirectoryName(String directory)

/**
* @return a {@link File} path to the {@code paket.lock} file in the project.
*/
File getPaketLockFile()
}
Expand Up @@ -26,7 +26,6 @@ class DefaultPaketUnityPluginExtension extends DefaultPaketPluginExtension imple

public static final String DEFAULT_PAKET_UNITY_REFERENCES_FILE_NAME = "paket.unity3d.references"
public static final String DEFAULT_PAKET_DIRECTORY = "Paket.Unity3D"
private static final String DEFAULT_PAKET_LOCK_FILE_NAME = "paket.lock"

protected String customPaketOutputDirectory

Expand All @@ -48,9 +47,4 @@ class DefaultPaketUnityPluginExtension extends DefaultPaketPluginExtension imple
void setPaketOutputDirectoryName(String directory) {
customPaketOutputDirectory = directory
}

@Override
File getPaketLockFile() {
return new File(project.projectDir, DEFAULT_PAKET_LOCK_FILE_NAME)
}
}

0 comments on commit 7517f86

Please sign in to comment.