| 
									
										
										
										
											2020-08-15 14:42:21 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-19 21:11:19 +03:00
										 |  |  | apply plugin: "eclipse" | 
					
						
							| 
									
										
										
										
											2020-08-16 22:39:00 +03:00
										 |  |  | apply plugin: "java" | 
					
						
							| 
									
										
										
										
											2020-08-15 14:42:21 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | description = "Source Sets example" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-16 22:39:00 +03:00
										 |  |  | task printSourceSetInformation(){ | 
					
						
							| 
									
										
										
										
											2020-08-18 21:52:30 +03:00
										 |  |  |     description = "Print source set information" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-15 14:42:21 +03:00
										 |  |  |     doLast{ | 
					
						
							| 
									
										
										
										
											2020-08-16 22:39:00 +03:00
										 |  |  |         sourceSets.each { srcSet -> | 
					
						
							|  |  |  |             println "["+srcSet.name+"]" | 
					
						
							|  |  |  |             print "-->Source directories: "+srcSet.allJava.srcDirs+"\n" | 
					
						
							|  |  |  |             print "-->Output directories: "+srcSet.output.classesDirs.files+"\n" | 
					
						
							|  |  |  |             print "-->Compile classpath:\n" | 
					
						
							|  |  |  |             srcSet.compileClasspath.files.each {  | 
					
						
							|  |  |  |                 print "  "+it.path+"\n" | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |             println "" | 
					
						
							| 
									
										
										
										
											2020-08-15 14:42:21 +03:00
										 |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-17 23:55:43 +03:00
										 |  |  | sourceSets{ | 
					
						
							|  |  |  |     itest { | 
					
						
							|  |  |  |         compileClasspath += sourceSets.main.output | 
					
						
							|  |  |  |         runtimeClasspath += sourceSets.main.output | 
					
						
							|  |  |  |         java { | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2020-08-16 22:39:00 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-17 23:55:43 +03:00
										 |  |  | test { | 
					
						
							|  |  |  |     testLogging { | 
					
						
							|  |  |  |         events "passed","skipped", "failed" | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2020-08-16 22:39:00 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-15 14:42:21 +03:00
										 |  |  | dependencies { | 
					
						
							|  |  |  |     implementation('org.apache.httpcomponents:httpclient:4.5.12') | 
					
						
							|  |  |  |     testImplementation('junit:junit:4.12') | 
					
						
							| 
									
										
										
										
											2020-08-17 23:55:43 +03:00
										 |  |  |     itestImplementation('com.google.guava:guava:29.0-jre') | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-18 21:52:30 +03:00
										 |  |  | task itest(type: Test) { | 
					
						
							|  |  |  |     description = "Run integration tests" | 
					
						
							|  |  |  |     group = "verification" | 
					
						
							|  |  |  |     testClassesDirs = sourceSets.itest.output.classesDirs | 
					
						
							|  |  |  |     classpath = sourceSets.itest.runtimeClasspath | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | itest { | 
					
						
							|  |  |  |     testLogging { | 
					
						
							|  |  |  |         events "passed","skipped", "failed" | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-17 23:55:43 +03:00
										 |  |  | configurations { | 
					
						
							|  |  |  |     itestImplementation.extendsFrom(testImplementation) | 
					
						
							| 
									
										
										
										
											2020-08-18 21:52:30 +03:00
										 |  |  |     itestRuntimeOnly.extendsFrom(testRuntimeOnly) | 
					
						
							| 
									
										
										
										
											2020-08-15 14:42:21 +03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-19 21:11:19 +03:00
										 |  |  | eclipse { | 
					
						
							|  |  |  |     classpath { | 
					
						
							|  |  |  |         plusConfigurations+=[configurations.itestCompileClasspath]  | 
					
						
							|  |  |  |     }  | 
					
						
							|  |  |  | } |