Şöyle yaparız
id 'org.unbroken-dome.test-sets' version '4.0.0'testSets {integrationTest}
Çalıştırmak için şöyle yaparız
./gradlew integrationTest
plugins { ... id "org.sonarqube" version "3.3" }
systemProp.sonar.host.url=http://localhost:9000 systemProp.sonar.login=<sonar-key>
sonarqube { properties { property "sonar.branch.name", System.getenv('BRANCH_NAME') } }
sonarqube { properties { property "sonar.projectKey", "luizgustavocosta_16-bits-zero-to-hero" property "sonar.organization", "luizgustavocosta" property "sonar.host.url", "https://sonarcloud.io" } }
./gradlew clean build
./gradlew sonarqube -Dsonar.projectKey=spring-boot-simple
-Dsonar.host.url=http://localhost:9000
-Dsonar.login=da55e6a2a39868ae22bd77aaf48e61c26b19d8b7
plugins {id 'distribution'}distributions {main {contents {from(projectDir) {include 'scripts/**'include 'doc/**'}}}}jar.enabled = falsedistTar.enabled = false
plugins {// Apply the java-library plugin for API and implementation separation.id 'java-library'id 'checkstyle'}
config\checkstyle\checkstyle.xml
checkstyle {
configFile = file("${rootDir}/config/checkstyle/checkstyle.xml")
}
checkstyleMain {
source ='src/main/java'
}
checkstyleTest {
source ='src/test/java'
}gradle check
The Checkstyle plugin adds the following dependencies to tasks defined by the Java plugin.checkDepends on: All Checkstyle tasks, including checkstyleMain and checkstyleTest.
gradle build
ÖrnekThe Eclipse plugins generate files that are used by the Eclipse IDE, thus making it possible to import the project into Eclipse (File - Import… - Existing Projects into Workspace).
plugins {id 'eclipse'}eclipse {classpath {downloadJavadoc = falsedownloadSources = true}}
<dependencyManagement><dependencies><dependency>...</dependency><dependencies><dependencyManagement><dependencyManagement><dependencies><dependency>...</dependency><dependencies><dependencyManagement>
import java.util.regex.Matchertask fixPom { doLast { File file = new File("$buildDir/publications/maven_1/pom-default.xml") if (!file.exists()) { return; } println("Fixing pom for " + file.getPath()) def text = file.text def pattern = "(?s)(<dependencyManagement>.+?<dependencies>)(.+?)(</dependencies>.+?</dependencyManagement>)" Matcher matcher = text =~ pattern if (matcher.find()) { //Remove the first <dependencyManagement> tag text = text.replaceFirst(pattern, "") //Get all all <dependency> tags def firstDeps = matcher.group(2) //Get (<dependencyManagement>.+?<dependencies>)(.+?) part //add new dependencies and close the tag text = text.replaceFirst(pattern, '$1$2' + firstDeps + '$3') } file.write(text) } }
generatePomPropertiesFile.dependsOn("fixPom")ompileJava processResources classes createPropertiesFileForJar generatePomFileForMaven_1Publication fixPom //Burada araya girdim generatePomPropertiesFile writeManifestProperties jar createPropertiesFileForSourcesJar sourcesJar assemble
Giriş Açıklaması şöyle . Gradle Daemon arka planda çalışır. Çünkü Gradle'ı ayağa kaldırmak ve ilklendirmek çok uzun sürüyor. Gradle ru...