mirror of
https://gitee.com/dcren/initializr.git
synced 2025-12-21 19:10:00 +08:00
Add GradleKts build system
This commit adds a BuildSystem implementation for the Gradle Kotlin DSL See gh-851
This commit is contained in:
@@ -19,7 +19,8 @@ package io.spring.initializr.generator.buildsystem.gradle;
|
|||||||
import io.spring.initializr.generator.buildsystem.BuildSystem;
|
import io.spring.initializr.generator.buildsystem.BuildSystem;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gradle {@link BuildSystem}.
|
* Gradle {@link BuildSystem} using the Groovy DSL (i.e. settings.gradle and
|
||||||
|
* build.gradle).
|
||||||
*
|
*
|
||||||
* @author Andy Wilkinson
|
* @author Andy Wilkinson
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2012-2019 the original author or authors.
|
||||||
|
*
|
||||||
|
* Licensed 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 io.spring.initializr.generator.buildsystem.gradle;
|
||||||
|
|
||||||
|
import io.spring.initializr.generator.buildsystem.BuildSystem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gradle {@link BuildSystem} using the Kotlin DSL (i.e. settings.gradle.kts and
|
||||||
|
* build.gradle.kts).
|
||||||
|
*
|
||||||
|
* @author Jean-Baptiste Nizet
|
||||||
|
*/
|
||||||
|
public final class GradleKtsBuildSystem implements BuildSystem {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gradle KTS {@link BuildSystem} identifier.
|
||||||
|
*/
|
||||||
|
public static final String ID = "gradle-kts";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String id() {
|
||||||
|
return ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return id();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2012-2019 the original author or authors.
|
||||||
|
*
|
||||||
|
* Licensed 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 io.spring.initializr.generator.buildsystem.gradle;
|
||||||
|
|
||||||
|
import io.spring.initializr.generator.buildsystem.BuildSystem;
|
||||||
|
import io.spring.initializr.generator.buildsystem.BuildSystemFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@link BuildSystemFactory Factory} for {@link GradleKtsBuildSystem}.
|
||||||
|
*
|
||||||
|
* @author Jean-Baptiste Nizet
|
||||||
|
*/
|
||||||
|
class GradleKtsBuildSystemFactory implements BuildSystemFactory {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BuildSystem createBuildSystem(String id) {
|
||||||
|
if (GradleKtsBuildSystem.ID.equals(id)) {
|
||||||
|
return new GradleKtsBuildSystem();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
io.spring.initializr.generator.buildsystem.BuildSystemFactory=\
|
io.spring.initializr.generator.buildsystem.BuildSystemFactory=\
|
||||||
io.spring.initializr.generator.buildsystem.gradle.GradleBuildSystemFactory,\
|
io.spring.initializr.generator.buildsystem.gradle.GradleBuildSystemFactory,\
|
||||||
|
io.spring.initializr.generator.buildsystem.gradle.GradleKtsBuildSystemFactory,\
|
||||||
io.spring.initializr.generator.buildsystem.maven.MavenBuildSystemFactory
|
io.spring.initializr.generator.buildsystem.maven.MavenBuildSystemFactory
|
||||||
|
|
||||||
io.spring.initializr.generator.language.LanguageFactory=\
|
io.spring.initializr.generator.language.LanguageFactory=\
|
||||||
|
|||||||
Reference in New Issue
Block a user