File tree Expand file tree Collapse file tree 3 files changed +22
-12
lines changed
rewrite-csharp-remote-server
src/test/java/org/openrewrite/csharp/remote Expand file tree Collapse file tree 3 files changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ IEnumerable<AbsolutePath> GetSubDirectories(params string[] patterns)
118118
119119 Target Pack => _ => _
120120 . Description ( "Creates nuget packages inside artifacts directory" )
121- . DependsOn ( Restore )
121+ . DependsOn ( Restore , PublishServer )
122122 . Executes ( ( ) =>
123123 {
124124 DotNetPack ( x => x
@@ -135,6 +135,8 @@ IEnumerable<AbsolutePath> GetSubDirectories(params string[] patterns)
135135 . SetVersion ( "0.0.1" )
136136 . SetAssemblyVersion ( Version . AssemblyVersion )
137137 . SetOutputDirectory ( ArtifactsDirectory / "test" ) ) ;
138+
139+
138140 } ) ;
139141
140142 Target PublishServer => _ => _
@@ -146,6 +148,9 @@ IEnumerable<AbsolutePath> GetSubDirectories(params string[] patterns)
146148 DotNetPublish ( c => c
147149 . SetProject ( Solution . src . Rewrite_Server )
148150 . SetVersion ( Version . NuGetPackageVersion ) ) ;
151+
152+ var publishDir = Solution . src . Rewrite_Server . Directory / "bin" / "Release" / "net8.0" / "publish" ;
153+ publishDir . ZipTo ( ArtifactsDirectory / "DotnetServer.zip" ) ;
149154 } ) ;
150155
151156 Target StopServer => _ => _
Original file line number Diff line number Diff line change @@ -36,17 +36,18 @@ dependencies {
3636}
3737
3838
39- tasks.register<Zip >(" zipDotnetServer" ) {
40- archiveFileName.set(" DotnetServer.zip" )
41- destinationDirectory.set(layout.buildDirectory.dir(" tmp" ))
42- from(rootProject.file(" Rewrite/src/Rewrite.Server/bin/Release/net8.0/publish" ))
43- include(" *" )
44- include(" */*" ) // to include contents of a folder present inside Reports directory
45- }
39+ // tasks.register<Zip>("zipDotnetServer") {
40+ // archiveFileName.set("DotnetServer.zip")
41+ // destinationDirectory.set(layout.buildDirectory.dir("tmp"))
42+ // from(rootProject.file("Rewrite/src/Rewrite.Server/bin/Release/net8.0/publish"))
43+ // include("*")
44+ // include("*/*") //to include contents of a folder present inside Reports directory
45+ // }
4646
4747tasks.processResources {
48- dependsOn(" zipDotnetServer" )
49- from(layout.buildDirectory.file(" tmp/DotnetServer.zip" ))
48+ // dependsOn("zipDotnetServer")
49+ // from(layout.buildDirectory.file("tmp/DotnetServer.zip"))
50+ from(layout.buildDirectory.file(rootProject.file(" artifacts/DotnetServer.zip" ).absolutePath))
5051}
5152
5253tasks.compileJava {
Original file line number Diff line number Diff line change 3636
3737import java .io .File ;
3838import java .io .IOException ;
39+ import java .net .URL ;
3940import java .nio .file .Path ;
4041import java .nio .file .Paths ;
4142import java .util .ArrayList ;
@@ -58,9 +59,13 @@ public void testRemotingRecipeInstallAndRun() throws IOException {
5859 port = 54321 ;
5960 Path extractedDotnetBinaryDir = Paths .get ("./build/dotnet-servet-archive" );
6061 extractedDotnetBinaryDir .toFile ().mkdirs ();
62+ Path artifactsFolder = GitRootFinder .getGitRoot ().resolve ("artifacts" ).toAbsolutePath ();
63+ URL test = Thread .currentThread ()
64+ .getContextClassLoader ()
65+ .getResource ("DotnetServer.zip" );
6166 var serverConfig = DotNetRemotingServerEngine .Config .builder ()
6267 .extractedDotnetBinaryDir (extractedDotnetBinaryDir )
63- .logFilePath (Paths . get ( "./build/ test.log" ).toAbsolutePath ().toString ())
68+ .logFilePath (artifactsFolder . resolve ( " test-results" ). resolve ( "csharp-server .log" ).toAbsolutePath ().toString ())
6469 .nugetPackagesFolder (nuPkgLocation .toPath ().toAbsolutePath ().normalize ().toString ())
6570 .port (port )
6671 .build ();
@@ -76,7 +81,6 @@ public void testRemotingRecipeInstallAndRun() throws IOException {
7681
7782 RemotingRecipeManager manager = new RemotingRecipeManager (server , () -> server );
7883
79- Path artifactsFolder = GitRootFinder .getGitRoot ().resolve ("artifacts" );
8084
8185 InstallableRemotingRecipe recipes = manager .install (
8286 "Rewrite.Recipes" ,
You can’t perform that action at this time.
0 commit comments