-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from vania-pooh/master
Added plugin development specific implementations
- Loading branch information
Showing
37 changed files
with
836 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
stecker-plugin-loader/src/main/java/ru/meridor/stecker/dev/BuildToolClassLoaderFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package ru.meridor.stecker.dev; | ||
|
||
import ru.meridor.stecker.PluginException; | ||
import ru.meridor.stecker.impl.PluginUtils; | ||
|
||
import java.nio.file.Path; | ||
|
||
public class BuildToolClassLoaderFactory { | ||
|
||
public static ClassLoader getClassLoader(Path baseDirectory, BuildToolType buildToolType) throws PluginException { | ||
switch (buildToolType) { | ||
default: | ||
case MAVEN: { | ||
return PluginUtils.getClassLoader( | ||
getClassesPath(baseDirectory, buildToolType), | ||
getDependenciesPath(baseDirectory, buildToolType) | ||
); | ||
} | ||
} | ||
} | ||
|
||
public static Path getClassesPath(Path baseDirectory, BuildToolType buildToolType) { | ||
switch (buildToolType) { | ||
default: | ||
case MAVEN: | ||
return getTargetDirectory(baseDirectory).resolve("classes"); | ||
} | ||
} | ||
|
||
public static Path getDependenciesPath(Path baseDirectory, BuildToolType buildToolType) { | ||
switch (buildToolType) { | ||
default: | ||
case MAVEN: | ||
return getTargetDirectory(baseDirectory).resolve("plugin-generator").resolve("data").resolve("lib"); | ||
} | ||
} | ||
|
||
private static Path getTargetDirectory(Path baseDirectory) { | ||
return baseDirectory.resolve("target"); | ||
} | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
stecker-plugin-loader/src/main/java/ru/meridor/stecker/dev/BuildToolType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package ru.meridor.stecker.dev; | ||
|
||
public enum BuildToolType { | ||
|
||
//TODO: we may want to add other tools like Gradle and SBT | ||
MAVEN | ||
|
||
} |
Oops, something went wrong.