From 540c9d0468f3847e50be721e1bf16e5feb5fd63a Mon Sep 17 00:00:00 2001 From: Laszlo Kishalmi Date: Wed, 10 Apr 2024 23:03:23 -0700 Subject: [PATCH] Gradle Groovy Application/Library Project Creation Wizards --- groovy/gradle.groovy/licenseinfo.xml | 32 +++++++++ groovy/gradle.groovy/manifest.mf | 2 + .../nbproject/project.properties | 3 +- groovy/gradle.groovy/nbproject/project.xml | 26 ++++++- .../modules/gradle/groovy/Bundle.properties | 1 + .../netbeans/modules/gradle/groovy/layer.xml | 32 +++++++++ .../SimpleApplicationDescription.html | 30 ++++++++ .../newproject/SimpleLibraryDescription.html | 28 ++++++++ .../gradle/groovy/newproject/Wizards.java | 66 ++++++++++++++++++ .../groovy/resources/groovyProjectIcon.png | Bin 0 -> 491 bytes .../resources/groovyProjectIcon_dark.png | Bin 0 -> 585 bytes 11 files changed, 218 insertions(+), 2 deletions(-) create mode 100644 groovy/gradle.groovy/licenseinfo.xml create mode 100644 groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/layer.xml create mode 100644 groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/newproject/SimpleApplicationDescription.html create mode 100644 groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/newproject/SimpleLibraryDescription.html create mode 100644 groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/newproject/Wizards.java create mode 100644 groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/resources/groovyProjectIcon.png create mode 100644 groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/resources/groovyProjectIcon_dark.png diff --git a/groovy/gradle.groovy/licenseinfo.xml b/groovy/gradle.groovy/licenseinfo.xml new file mode 100644 index 000000000000..5d85a36f8b49 --- /dev/null +++ b/groovy/gradle.groovy/licenseinfo.xml @@ -0,0 +1,32 @@ + + + + + src/org/netbeans/modules/gradle/groovy/resources/groovyProjectIcon.png + src/org/netbeans/modules/gradle/groovy/resources/groovyProjectIcon_dark.png + + + Icons are based based on artwork available on the https://gradle.org/brand/ . + More specificly: https://gradle.com/brand_assets/Gradle_Elephant_Icon_Assets.zip + + + diff --git a/groovy/gradle.groovy/manifest.mf b/groovy/gradle.groovy/manifest.mf index 4db90ca6b8c2..4caa182831f5 100644 --- a/groovy/gradle.groovy/manifest.mf +++ b/groovy/gradle.groovy/manifest.mf @@ -1,6 +1,8 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.gradle.groovy +OpenIDE-Module-Layer: org/netbeans/modules/gradle/groovy/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/gradle/groovy/Bundle.properties +OpenIDE-Module-Java-Dependencies: Java > 17 OpenIDE-Module-Specification-Version: 1.13 diff --git a/groovy/gradle.groovy/nbproject/project.properties b/groovy/gradle.groovy/nbproject/project.properties index 20bd560eb6e8..a87fc26142a9 100644 --- a/groovy/gradle.groovy/nbproject/project.properties +++ b/groovy/gradle.groovy/nbproject/project.properties @@ -14,6 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -javac.source=1.8 +javac.source=17 +javac.target=17 javac.compilerargs=-Xlint -Xlint:-serial is.eager=true diff --git a/groovy/gradle.groovy/nbproject/project.xml b/groovy/gradle.groovy/nbproject/project.xml index 73eb85d61fb9..d5fcdb09c71c 100644 --- a/groovy/gradle.groovy/nbproject/project.xml +++ b/groovy/gradle.groovy/nbproject/project.xml @@ -25,13 +25,21 @@ org.netbeans.modules.gradle.groovy + + org.netbeans.api.templates + + + + 1.32 + + org.netbeans.modules.gradle 2 - 2.6 + 2.40 @@ -69,6 +77,22 @@ 1.78 + + org.openide.dialogs + + + + 7.71 + + + + org.openide.util + + + + 9.32 + + diff --git a/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/Bundle.properties b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/Bundle.properties index 3ccfb20d120a..87bc577eef0e 100644 --- a/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/Bundle.properties +++ b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/Bundle.properties @@ -15,3 +15,4 @@ # specific language governing permissions and limitations # under the License. OpenIDE-Module-Name=Gradle Groovy +Templates/Project/GradleGroovy=Groovv with Gradle \ No newline at end of file diff --git a/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/layer.xml b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/layer.xml new file mode 100644 index 000000000000..719ece5b5bda --- /dev/null +++ b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/layer.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + diff --git a/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/newproject/SimpleApplicationDescription.html b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/newproject/SimpleApplicationDescription.html new file mode 100644 index 000000000000..eb4cb300c770 --- /dev/null +++ b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/newproject/SimpleApplicationDescription.html @@ -0,0 +1,30 @@ + + + + + + + Creates a simple Groovy application Gradle project. An empty main + class is also going to be created in the project. + + + diff --git a/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/newproject/SimpleLibraryDescription.html b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/newproject/SimpleLibraryDescription.html new file mode 100644 index 000000000000..5d4fb171c0e0 --- /dev/null +++ b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/newproject/SimpleLibraryDescription.html @@ -0,0 +1,28 @@ + + + + + + + Creates a new Groovy library Gradle project. + + diff --git a/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/newproject/Wizards.java b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/newproject/Wizards.java new file mode 100644 index 000000000000..c7b49b20a106 --- /dev/null +++ b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/newproject/Wizards.java @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.netbeans.modules.gradle.groovy.newproject; + +import java.util.List; +import org.netbeans.api.templates.TemplateRegistration; +import org.netbeans.modules.gradle.spi.newproject.BaseGradleWizardIterator; +import org.netbeans.modules.gradle.spi.newproject.GradleInitWizard; +import org.openide.util.NbBundle; + +/** + * + * @author lkishalmi + */ +public class Wizards { + + private Wizards() {} + + private static final List JAVA_VERSIONS = List.of(21, 17, 11, 8); + + @TemplateRegistration(folder="Project/GradleGroovy", position=350, displayName="#template.simpleAppProject", iconBase="org/netbeans/modules/gradle/groovy/resources/groovyProjectIcon.png", description="SimpleApplicationDescription.html") + @NbBundle.Messages({ + "template.simpleAppProject=Groovy Application", + "LBL_SimpleApplicationProject=Groovy Application with Gradle" + }) + public static BaseGradleWizardIterator createJavaApplication() { + return GradleInitWizard.create("groovy-application", Bundle.LBL_SimpleApplicationProject()) + .withJavaVersions(JAVA_VERSIONS) + .withImportantPaths(List.of( + "app", + "app/src/main/groovy/${package}/App.groovy" + )) + .build(); + } + + @TemplateRegistration(folder="Project/GradleGroovy", position=360, displayName="#template.simpleLibProject", iconBase="org/netbeans/modules/gradle/groovy/resources/groovyProjectIcon.png", description="SimpleLibraryDescription.html") + @NbBundle.Messages({ + "template.simpleLibProject=Groovy Class Library", + "LBL_SimpleLibraryProject=Groovy Class Library with Gradle" + }) + public static BaseGradleWizardIterator createJavaLibrary() { + return GradleInitWizard.create("groovy-library", Bundle.LBL_SimpleApplicationProject()) + .withJavaVersions(JAVA_VERSIONS) + .withImportantPaths(List.of( + "lib", + "lib/src/main/groovy/${package}/Library.groovy" + )) + .build(); + } +} diff --git a/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/resources/groovyProjectIcon.png b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/resources/groovyProjectIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..33c23863a1b354af1415ba3d41fcdb751b619939 GIT binary patch literal 491 zcmVE549 z7Z0Aj)xoQ~2;#*ekh++n(TX0i)Y!5K+1zXDM11dkJ480h!@LN7k6(V@&+q%=2b?u^ zGnSa=m1}ug(Wd|+JRzV1hLM7_&C8w7uvK{RFQAKNco>bb0Ysunc-{e=Vn#d8G<+`& z;NWPo?%ZQu?S4=Vh_mPBR|bQ1$E{Ym^iBEC<8a+c03I*2%%M5a`xihCGM;?GL~9BF zBnkU_C0g}O0HFNpbHtN<2!QasLz-4pYj)ZI0GgpOUcWV?;$~WsRM{=bUU`V!a^a|f zQ=A7pmq9Z`(~7FH=V-@yL;xw?xV=Qu&{pB2z89uQBZRiDQCgA4W6#;I{8TnG1nD&y zIX}sco_n>vL8TvGl**T(uQ06^J!^B002ovPDHLkV1lN`;`aam literal 0 HcmV?d00001 diff --git a/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/resources/groovyProjectIcon_dark.png b/groovy/gradle.groovy/src/org/netbeans/modules/gradle/groovy/resources/groovyProjectIcon_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..dd6cb8bcc7586205455f3111eb1621380241beb8 GIT binary patch literal 585 zcmV-P0=E5$P)xl(5Ah42o9f&BB|El7x`4jNPQ&D0Wfaj3o@UVqjQ{bjVu`-*-z(tWKcEhr zoAZ3n=bY!91N>9QHAkSn_tyKviG=QJK0iuCZu*PX2FBb_ssN>OLo_G+h1as?wh`(-Kq?B(*r>sYZ+n6|W=_xZ0M?7wqk z4M1%BwkMMd(k{4U3X+#xa0ST}B$?{#^P%y@(ZnNV8ioD0dmnI^ssv!%V?Pm!lD?eZ zaxu~>IAEmT&KGkF-(0~{0m&6UM7sNYZEfc^`f6Pke5$3rivVcarRcPy>Bt^EdZkbE zH#V5F=^27jo~w}#VHaHTQU{VNNI@jH!dxsC|2Q;!npo}b%g&omqb1R5u`o6=<*aY0 ztJ+n!!>VL`NpL`tq0-@Se{N#36M!N3@iS+M00ICeSamRTNOA=th4O%?