From 4bf1d51d431a419ae6a06954751152a3a9315f31 Mon Sep 17 00:00:00 2001 From: Vladimir Petko Date: Mon, 7 Oct 2024 09:24:47 +1300 Subject: [PATCH 1/2] feat: add maven push rock mojo --- .../src/it/manual-create-rock-test/pom.xml | 1 + .../rockcraft/maven/PushRockMojo.java | 33 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 rockcraft-maven/src/main/java/com/canonical/rockcraft/maven/PushRockMojo.java diff --git a/rockcraft-maven/src/it/manual-create-rock-test/pom.xml b/rockcraft-maven/src/it/manual-create-rock-test/pom.xml index 9fe078a..6af0b1b 100644 --- a/rockcraft-maven/src/it/manual-create-rock-test/pom.xml +++ b/rockcraft-maven/src/it/manual-create-rock-test/pom.xml @@ -20,6 +20,7 @@ create-rock build-rock + push-rock diff --git a/rockcraft-maven/src/main/java/com/canonical/rockcraft/maven/PushRockMojo.java b/rockcraft-maven/src/main/java/com/canonical/rockcraft/maven/PushRockMojo.java new file mode 100644 index 0000000..6be4ff5 --- /dev/null +++ b/rockcraft-maven/src/main/java/com/canonical/rockcraft/maven/PushRockMojo.java @@ -0,0 +1,33 @@ +/** + * 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. + *

+ * 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 . + */ +package com.canonical.rockcraft.maven; + +import com.canonical.rockcraft.builder.RockBuilder; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; + +import java.io.IOException; + +@Mojo(name = "push-rock", threadSafe = false, requiresProject = true, defaultPhase = LifecyclePhase.INSTALL) +public class PushRockMojo extends AbstractRockMojo { + public void execute() throws MojoExecutionException { + super.execute(); + try { + RockBuilder.pushRock(RockSettingsFactory.createRockProjectSettings(getProject()), getOptions()); + } catch (InterruptedException | IOException e) { + throw new MojoExecutionException(e.getMessage(), e); + } + } +} From 45eb64ee8280eef15eb6d301f386c38b544682d0 Mon Sep 17 00:00:00 2001 From: Vladimir Petko Date: Tue, 8 Oct 2024 17:05:36 +1300 Subject: [PATCH 2/2] test: use main chisel-releases repo --- rockcraft-maven/src/it/manual-create-rock-test/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rockcraft-maven/src/it/manual-create-rock-test/pom.xml b/rockcraft-maven/src/it/manual-create-rock-test/pom.xml index 6af0b1b..4bad134 100644 --- a/rockcraft-maven/src/it/manual-create-rock-test/pom.xml +++ b/rockcraft-maven/src/it/manual-create-rock-test/pom.xml @@ -31,8 +31,8 @@ false

foo readme.txt - https://github.com/vpa1977/chisel-releases - 24.04-openjdk-17 + https://github.com/canonical/chisel-releases + ubuntu-24.04 amd64 arm64