Skip to content

Commit

Permalink
Gradle Groovy Application/Library Project Creation Wizards
Browse files Browse the repository at this point in the history
  • Loading branch information
lkishalmi committed Apr 11, 2024
1 parent bb66c85 commit 0125e7a
Show file tree
Hide file tree
Showing 9 changed files with 184 additions and 2 deletions.
32 changes: 32 additions & 0 deletions groovy/gradle.groovy/licenseinfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<licenseinfo>
<fileset>
<file>src/org/netbeans/modules/gradle/groovy/resources/groovyProjectIcon.png</file>
<file>src/org/netbeans/modules/gradle/groovy/resources/groovyProjectIcon_dark.png</file>
<license ref="Gradle-icon"/>
<comment type="COMMENT_UNSUPPORTED">
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
</comment>
</fileset>
</licenseinfo>
1 change: 1 addition & 0 deletions groovy/gradle.groovy/manifest.mf
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ Manifest-Version: 1.0
AutoUpdate-Show-In-Client: false
OpenIDE-Module: org.netbeans.modules.gradle.groovy
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/gradle/groovy/Bundle.properties
OpenIDE-Module-Java-Dependencies: Java > 17
OpenIDE-Module-Specification-Version: 1.13

3 changes: 2 additions & 1 deletion groovy/gradle.groovy/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
26 changes: 25 additions & 1 deletion groovy/gradle.groovy/nbproject/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,21 @@
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
<code-name-base>org.netbeans.modules.gradle.groovy</code-name-base>
<module-dependencies>
<dependency>
<code-name-base>org.netbeans.api.templates</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>1.32</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.netbeans.modules.gradle</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<release-version>2</release-version>
<specification-version>2.6</specification-version>
<specification-version>2.40</specification-version>
</run-dependency>
</dependency>
<dependency>
Expand Down Expand Up @@ -69,6 +77,22 @@
<specification-version>1.78</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.openide.dialogs</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>7.71</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.openide.util</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>9.32</specification-version>
</run-dependency>
</dependency>
</module-dependencies>
<public-packages/>
</data>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!--
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.
-->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<b>Creates a simple Groovy application</b> Gradle project. An empty main
class is also going to be created in the project.
</body>
</html>

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
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.
-->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<b>Creates a new Groovy library</b> Gradle project.
</body>
</html>
Original file line number Diff line number Diff line change
@@ -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<Integer> JAVA_VERSIONS = List.of(21, 17, 11, 8);

@TemplateRegistration(folder="Project/Gradle", 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/Gradle", 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();
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0125e7a

Please sign in to comment.