forked from rockcrafters/java-rockcraft-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
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 rockcrafters#5 from vpa1977/rename-common-library
chore: refactor preparing to implement maven plugin
- Loading branch information
Showing
32 changed files
with
466 additions
and
293 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
allprojects { | ||
version = "0.1.1" | ||
group = "io.rockcrafters" | ||
} |
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
48 changes: 48 additions & 0 deletions
48
rockcraft-gradle/src/main/java/com/canonical/rockcraft/gradle/AbstractRockcraftTask.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,48 @@ | ||
/** | ||
* Copyright 2024 Canonical Ltd. | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 3 as | ||
* published by the Free Software Foundation. | ||
* <p> | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package com.canonical.rockcraft.gradle; | ||
|
||
import com.canonical.rockcraft.builder.RockcraftOptions; | ||
import org.gradle.api.DefaultTask; | ||
import org.gradle.api.tasks.Input; | ||
|
||
import javax.inject.Inject; | ||
|
||
/** | ||
* Base class for rockcraft tasks | ||
*/ | ||
public class AbstractRockcraftTask extends DefaultTask { | ||
|
||
@Input | ||
private final RockcraftOptions options; | ||
|
||
/** | ||
* Constructs the CreateRockcraft task | ||
* | ||
* @param options - plugin options | ||
*/ | ||
@Inject | ||
public AbstractRockcraftTask(RockcraftOptions options) { | ||
this.options = options; | ||
} | ||
|
||
/** | ||
* Gets rockcraft project options | ||
* | ||
* @return rockcraft project options | ||
*/ | ||
protected RockcraftOptions getOptions() { | ||
return options; | ||
} | ||
} |
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
27 changes: 27 additions & 0 deletions
27
rockcraft-gradle/src/main/java/com/canonical/rockcraft/gradle/RockSettingsFactory.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,27 @@ | ||
package com.canonical.rockcraft.gradle; | ||
|
||
import com.canonical.rockcraft.builder.RockProjectSettings; | ||
import org.gradle.api.Project; | ||
|
||
/** | ||
* Creates RockProjectSettings from Gradle project | ||
*/ | ||
public class RockSettingsFactory { | ||
|
||
/** | ||
* Constructs RockSettingsFactory | ||
*/ | ||
RockSettingsFactory() {} | ||
|
||
/** | ||
* Creates RockProjectSettings from Gradle project | ||
* | ||
* @param project - gradle project | ||
* @return RockProjectSettings | ||
*/ | ||
public static final RockProjectSettings createRockProjectSettings(Project project) { | ||
return new RockProjectSettings("gradle", project.getName(), | ||
String.valueOf(project.getVersion()), project.getProjectDir().toPath(), | ||
project.getLayout().getBuildDirectory().getAsFile().get().toPath()); | ||
} | ||
} |
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
Oops, something went wrong.