BAEL-4516: First structure
This commit is contained in:
		
							parent
							
								
									660b20c569
								
							
						
					
					
						commit
						04fe338707
					
				| @ -1,3 +1,4 @@ | ||||
| rootProject.name='gradle-5-articles' | ||||
| include 'java-exec' | ||||
| include 'unused-dependencies' | ||||
| include 'unused-dependencies' | ||||
| include 'source-sets' | ||||
							
								
								
									
										35
									
								
								gradle-5/source-sets/build.gradle
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								gradle-5/source-sets/build.gradle
									
									
									
									
									
										Normal 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]  | ||||
|     }  | ||||
| } | ||||
| @ -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)); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,9 @@ | ||||
| package com.baeldung.main; | ||||
| 
 | ||||
| public class SourceSetsMain { | ||||
| 
 | ||||
|     public static void main(String[] args) { | ||||
|         System.out.println("Hell..oh...world!"); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| @ -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)); | ||||
|     } | ||||
| } | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user