Skip to content

Commit

Permalink
Merge pull request rockcrafters#19 from vpa1977/rollback-rename
Browse files Browse the repository at this point in the history
chore: rename plugin to com.canonical.rockcraft
  • Loading branch information
vpa1977 authored Sep 30, 2024
2 parents 2ae3bec + eacca36 commit e3392d1
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 39 deletions.
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ To use the plugin, apply the following two steps:
**Groovy**

plugins {
id 'com.canonical.rockcraft-plugin' version '0.0.1'
id 'com.canonical.rockcraft' version '0.1.1'
}

**Kotlin**

plugins {
id("com.canonical.rockcraft-plugin") version "0.1.0"
id("com.canonical.rockcraft") version "0.1.1"
}

##### Alternatively, you can use the `buildscript` DSL:
Expand All @@ -39,7 +39,7 @@ To use the plugin, apply the following two steps:
}
}
dependencies {
classpath 'com.canonical.rockcraft-plugin:0.0.1'
classpath 'com.canonical.rockcraft:0..1'
}
}
apply plugin: 'com.canonical.rockcraft-plugin'
Expand All @@ -53,10 +53,10 @@ To use the plugin, apply the following two steps:
}
}
dependencies {
classpath("com.canonical.rockcraft-plugin:0.0.1")
classpath("com.canonical.rockcraft:0.1.1")
}
}
apply(plugin = "com.canonical.rockcraft-plugin")
apply(plugin = "com.canonical.rockcraft")


### 2. Configure ROCK container
Expand All @@ -67,24 +67,29 @@ target architectures and the startup service command line.
**Groovy**

rockcraft {
buildPackage = 'openjdk-21-jdk'
targetRelease = 21
summary = 'A ROCK summary'
description = 'README.md'
command = '/usr/bin/java -jar jars/application.jar'
source = 'http://github.com/myuser/chisel-releases'
branch = 'my-chisel-release-branch'
slices = ['busybox_bins', 'fontconfig_config']

architectures = ['amd64', 'arm64']
}

**Kotlin**

rockcraft {
buildPackage = "openjdk-21-jdk"
targetRelease = 21
summary = "A ROCK summary"
description = "README.md"
command = "/usr/bin/java -jar jars/application.jar"
source = "http://github.com/myuser/chisel-releases"
branch = "my-chisel-release-branch"
slices("busybox_bins", "fontconfig_config")
architectures("amd64", "arm64")
}

## Issues and Contributions
Expand All @@ -95,6 +100,6 @@ Contributions can be submitted via [Pull requests](https://github.com/canonical/

# TODO

- Allow runtime package/version customisation.
- Allow custom rockcraft.yaml/snippets
- Error handling (empty jar file), no main class

11 changes: 5 additions & 6 deletions rockcraft-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
id("com.gradle.plugin-publish") version "1.3.0"
}

group = "io.github.vpa1977"
group = "com.canonical"
version = "0.1.1"

repositories {
Expand All @@ -21,7 +21,6 @@ dependencies {

testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")

}

gradlePlugin {
Expand All @@ -30,10 +29,10 @@ gradlePlugin {

plugins {
create("rockcraftPlugin") {
id = "io.github.vpa1977.rockcraft-plugin"
displayName = "ROCK plugin"
description = "Plugin for ROCK generation"
implementationClass = "io.github.vpa1977.rockcraft.plugin.RockcraftPlugin"
id = "com.canonical.rockcraft"
displayName = "Rockcraft plugin"
description = "Plugin for rock image generation"
implementationClass = "com.canonical.rockcraft.plugin.RockcraftPlugin"
tags = listOf("rockcraft", "rock", "container", "docker", "oci")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

import java.io.IOException;

/**
* Gradle plugin for Rockcraft.
* Allows to build rock images for Gradle projects.
*/
public class RockcraftPlugin implements Plugin<Project> {

/**
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static void main(String[] args) {
"""
plugins {
id('application')
id('io.github.vpa1977.rockcraft-plugin')
id('com.canonical.rockcraft')
}
""");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void buildRockJava11Test() throws IOException {
writeString(getBuildFile(), """
plugins {
id('java')
id('io.github.vpa1977.rockcraft-plugin')
id('com.canonical.rockcraft')
}
rockcraft {
Expand All @@ -75,7 +75,7 @@ void rockcraftPluginOptions() throws IOException {
writeString(getBuildFile(), """
plugins {
id('java')
id('io.github.vpa1977.rockcraft-plugin')
id('com.canonical.rockcraft')
}
rockcraft {
Expand All @@ -101,7 +101,7 @@ void testArchitecture() throws IOException {
writeString(getBuildFile(), """
plugins {
id('java')
id('io.github.vpa1977.rockcraft-plugin')
id('com.canonical.rockcraft')
}
rockcraft {
Expand All @@ -126,7 +126,7 @@ void onlySingleRockExists() throws IOException {
writeString(getBuildFile(), """
plugins {
id('java')
id('io.github.vpa1977.rockcraft-plugin')
id('com.canonical.rockcraft')
}
version = 0.01
Expand All @@ -142,7 +142,7 @@ void onlySingleRockExists() throws IOException {
writeString(getBuildFile(), """
plugins {
id('java')
id('io.github.vpa1977.rockcraft-plugin')
id('com.canonical.rockcraft')
}
version = '0.02updated'
Expand All @@ -163,7 +163,7 @@ void testAllOptions() throws IOException {
writeString(getBuildFile(), """
plugins {
id('java')
id('io.github.vpa1977.rockcraft-plugin')
id('com.canonical.rockcraft')
}
version = 0.01
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ public class SpringBootTest extends BaseRockcraftTest {
protected void setUp() throws IOException {
String app = """
package com.example.app2;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
""";
Path javaDir = Path.of(projectDir.getAbsolutePath(), "src", "main", "java", "com", "example", "app2");
Expand All @@ -53,16 +53,16 @@ public static void main(String[] args) {
id 'java'
id 'org.springframework.boot' version '3.3.2'
id 'io.spring.dependency-management' version '1.1.6'
id 'io.github.vpa1977.rockcraft-plugin'
id 'com.canonical.rockcraft'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
Expand Down

0 comments on commit e3392d1

Please sign in to comment.