Add GradleKts build system

This commit adds a BuildSystem implementation for the Gradle Kotlin DSL

See gh-851
This commit is contained in:
jnizet 2019-03-03 10:16:15 +01:00 committed by Stephane Nicoll
parent 96f2b5fbab
commit 020d66be63
4 changed files with 84 additions and 1 deletions

View File

@ -19,7 +19,8 @@ package io.spring.initializr.generator.buildsystem.gradle;
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
*/

View File

@ -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();
}
}

View File

@ -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;
}
}

View File

@ -1,5 +1,6 @@
io.spring.initializr.generator.buildsystem.BuildSystemFactory=\
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.language.LanguageFactory=\