add minimal go setup
This commit is contained in:
		
							parent
							
								
									21738818d5
								
							
						
					
					
						commit
						df5e191582
					
				
							
								
								
									
										3
									
								
								.idea/misc.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										3
									
								
								.idea/misc.xml
									
									
									
										generated
									
									
									
								
							| @ -1,6 +1,9 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <project version="4"> | ||||
|   <component name="ExternalStorageConfigurationManager" enabled="true" /> | ||||
|   <component name="FrameworkDetectionExcludesConfiguration"> | ||||
|     <file type="web" url="file://$PROJECT_DIR$" /> | ||||
|   </component> | ||||
|   <component name="ProjectRootManager" version="2" languageLevel="JDK_24" default="true" project-jdk-name="openjdk-24" project-jdk-type="JavaSDK"> | ||||
|     <output url="file://$PROJECT_DIR$/out" /> | ||||
|   </component> | ||||
|  | ||||
| @ -18,7 +18,29 @@ dependencies { | ||||
| 
 | ||||
| tasks.test { | ||||
|     useJUnitPlatform() | ||||
|     dependsOn(testGo) | ||||
| } | ||||
| tasks.classes { | ||||
|     dependsOn(compileGo) | ||||
| } | ||||
| kotlin { | ||||
|     jvmToolchain(24) | ||||
| } | ||||
| 
 | ||||
| val compileGo = tasks.register("compileGo", Exec::class) { | ||||
|     group = "go" | ||||
|     workingDir(layout.projectDirectory) | ||||
|     commandLine("/usr/bin/go", "build", "-o", "build/go/planterette", "./src/main/go") | ||||
| } | ||||
| 
 | ||||
| val testGo = tasks.register("testGo", Exec::class) { | ||||
|     group = "go" | ||||
|     workingDir(layout.projectDirectory) | ||||
|     commandLine("/usr/bin/go", "test", "./src/main/go") | ||||
| } | ||||
| 
 | ||||
| val runGo = tasks.register("runGo", Exec::class) { | ||||
|     group = "go" | ||||
|     workingDir(layout.projectDirectory) | ||||
|     commandLine("/usr/bin/go", "run", "./src/main/go") | ||||
| } | ||||
							
								
								
									
										5
									
								
								src/main/go/main.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								src/main/go/main.go
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,5 @@ | ||||
| package main | ||||
| 
 | ||||
| func main() { | ||||
| 
 | ||||
| } | ||||
							
								
								
									
										10
									
								
								src/main/go/main_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								src/main/go/main_test.go
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,10 @@ | ||||
| package main | ||||
| 
 | ||||
| import ( | ||||
| 	"testing" | ||||
| 	_ "testing" | ||||
| ) | ||||
| 
 | ||||
| func TestHelloWorld(t *testing.T) { | ||||
| 
 | ||||
| } | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user