[GitHub] thrift pull request #1532: [WIP] THRIFT-4541: Use new project system in lib/...

2018-04-03 Thread cwe1ss
GitHub user cwe1ss opened a pull request:

https://github.com/apache/thrift/pull/1532

[WIP] THRIFT-4541: Use new project system in lib/csharp

See [THRIFT-4541](https://issues.apache.org/jira/browse/THRIFT-4541). 

This is a WIP/PoC and **MUST NOT BE MERGED** (because supported versions 
must be defined first etc).

This PR updates all project files to the new project system and targets 
".NET Standard 2.0" and ".NET 4.5". (Except for the MSBuild-task which 
currently can't target .NET 4.5 due to its dependencies)

Some notes about it:
* The solution can now be built using the cross-platform .NET Core SDK 
(v2.0+). (using the cmd `dotnet build`)
* I have not changed the MAKE files yet as I don't yet know how they work. 
I'll look into this once I know that we'll actually do this change.
* NuGet packages for the main Thrift library and for the MSBuild library 
can be created with `dotnet pack -c Release`. They will be placed in the 
"lib\csharp\artifacts" folder.
* `AssemblyInfo.cs` files are no longer required as most things are now 
defined either in `Directory.Build.props` or directly in the `*.csproj` files.
* **Thrift** project:
  * As there's some classes that depend on "System.Web" I already had to 
add some #if statements. These classes are only available when the package is 
consumed on the full .NET framework.
  * I also had to change something in `TNamedPipeServerTransport` as .NET 
standard doesn't have a NamedPipeServerStream constructor that accepts a 
PipeSecurity. We'll have to look into how to test this.
* **ThriftMSBuildTask** project:
  * I had to reference NuGet packages for MSBuild and these no longer 
contain the "Csc" class. I therefore had to change the implementation to 
manually call "csc". **This is not yet tested though!!** I wanted to show you 
the general approach first before I invest more time.
  * The project now creates a NuGet package that includes props files etc. 
I got this from [this 
how-to](https://www.natemcmaster.com/blog/2017/07/05/msbuild-task-in-nuget/).
* The test projects contain `PreBuildEvents` that generate `*.cs` files for 
`thrift` files. This currently is executed too late which results in the first 
build to fail. I still have to look into this or we should discuss using a 
different approach (e.g. using the MSBuild task)

I'm looking for general feedback on this approach. If the approach is ok, 
we should discuss in THRIFT-4541, which platforms we'd like to support. We can 
then either merge this into a branch or I can create a new PR with all changes.

/cc @Jens-G @jeking3 

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/cwe1ss/thrift cweiss/Netstd

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/thrift/pull/1532.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1532


commit 550df5b23dc9ba28198b8ccb92db46fb41be64e3
Author: Christian Weiss <christian@...>
Date:   2018-04-03T11:49:53Z

Target netstandard2.0 and net45




---


[GitHub] thrift issue #1524: THRIFT-4535: XML docs; code cleanup (tabs->spaces; Strin...

2018-03-31 Thread cwe1ss
Github user cwe1ss commented on the issue:

https://github.com/apache/thrift/pull/1524
  
The last AppVeyor failure seems to be unrelated:

>The following tests FAILED:
>  30 - HaskellCabalCheck (Failed)

I fixed the license header in another commit so we'll see if the build 
succeeds now. 

Do you want me to squash the commits or will you do that via Github if you 
decide to merge the PR?


---


[GitHub] thrift pull request #1524: THRIFT-4535: XML docs; code cleanup (tabs->spaces...

2018-03-31 Thread cwe1ss
Github user cwe1ss commented on a diff in the pull request:

https://github.com/apache/thrift/pull/1524#discussion_r178431239
  
--- Diff: lib/csharp/src/Protocol/TCompactProtocol.cs ---
@@ -7,7 +7,7 @@
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
  *
- *   http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
--- End diff --

This was by accident. I fixed it. thank you!


---


[GitHub] thrift pull request #1524: THRIFT-4535: XML docs; code cleanup (tabs->spaces...

2018-03-30 Thread cwe1ss
GitHub user cwe1ss opened a pull request:

https://github.com/apache/thrift/pull/1524

THRIFT-4535: XML docs; code cleanup (tabs->spaces; String->string)

As discussed in 
[THRIFT-4535](https://issues.apache.org/jira/browse/THRIFT-4535) we'd like to 
go back to just one .NET library that supports .NET framework (including Mono) 
AND .NET Core. 

As I had to learn about the library before doing some actual changes, I 
updated the files to contain proper XML comments (which can be used for 
IntelliSense) and I did some code cleanup. I did NOT change any code.

Feel free to close this PR, if you prefer to not have such a cleanup commit 
(for the sake of better git file history).

/cc @Jens-G @jeking3 

PS: I'll submit actual code changes once this PR is merged or rejected.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/cwe1ss/thrift cweiss/csharp

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/thrift/pull/1524.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1524


commit 3ea256cd578e729759dfcd59698133f0cecc6729
Author: Christian Weiss <christian@...>
Date:   2018-03-30T19:26:04Z

THRIFT-4535: XML docs; code cleanup (tabs->spaces; String->string)




---