BAEL-4516: First structure

This commit is contained in:
Sorin Zamfir 2020-08-15 14:42:21 +03:00
parent 660b20c569
commit 04fe338707
5 changed files with 84 additions and 1 deletions

View File

@ -1,3 +1,4 @@
rootProject.name='gradle-5-articles'
include 'java-exec'
include 'unused-dependencies'
include 'unused-dependencies'
include 'source-sets'

View File

@ -0,0 +1,35 @@
apply plugin: "eclipse"
description = "Source Sets example"
task printConfigurations(){
doLast{
configurations.each {
println it.name
}
}
}
sourceSets{
itest {
java {
}
}
}
dependencies {
implementation('org.apache.httpcomponents:httpclient:4.5.12')
testImplementation('junit:junit:4.12')
itestImplementation('com.google.guava:guava:29.0-jre')
}
configurations {
itestImplementation.extendsFrom(testImplementation)
}
eclipse {
classpath {
plusConfigurations+=[configurations.itestCompileClasspath]
}
}

View File

@ -0,0 +1,19 @@
package com.baeldung.itest;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import java.util.List;
import org.junit.Test;
import com.google.common.collect.ImmutableList;
public class SourceSetsItest {
@Test
public void whenRunThenFail() {
List<String> someStrings = ImmutableList.of("Baeldung", "is", "cool");
assertThat(false, is(true));
}
}

View File

@ -0,0 +1,9 @@
package com.baeldung.main;
public class SourceSetsMain {
public static void main(String[] args) {
System.out.println("Hell..oh...world!");
}
}

View File

@ -0,0 +1,19 @@
package com.baeldung.test;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import java.util.List;
import org.junit.Test;
import com.google.common.collect.ImmutableList;
public class SourceSetsTest {
@Test
public void whenRunThenSuccess() {
List<String> someStrings = ImmutableList.of("Baeldung", "is", "cool");
assertThat(true, is(true));
}
}