Repository: incubator-reef
Updated Branches:
  refs/heads/master 9da895cb9 -> e86b5b344


[REEF-224]: Automatically add a project reference to the JAR in our
            NuGets

Added a powerscript snippet to nuget.
Powershell snippet modifies the consuming build project so that jar file
is copied to project build output.

JIRA:
  [224](https://issues.apache.org/jira/browse/REEF-224)

Pull Request:
  This closes #128


Project: http://git-wip-us.apache.org/repos/asf/incubator-reef/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-reef/commit/e86b5b34
Tree: http://git-wip-us.apache.org/repos/asf/incubator-reef/tree/e86b5b34
Diff: http://git-wip-us.apache.org/repos/asf/incubator-reef/diff/e86b5b34

Branch: refs/heads/master
Commit: e86b5b3445ee1b0ca92d324f38c42259d9399865
Parents: 9da895c
Author: Beysim Sezgin <[email protected]>
Authored: Fri Mar 27 16:56:46 2015 -0700
Committer: Markus Weimer <[email protected]>
Committed: Fri Mar 27 19:06:42 2015 -0700

----------------------------------------------------------------------
 .../Org.Apache.REEF.Bridge.JAR.csproj           | 57 ++++++++++++--------
 .../Org.Apache.REEF.Bridge.JAR.nuspec           |  1 +
 .../Org.Apache.REEF.Client.csproj               |  2 +-
 .../Org.Apache.REEF.Evaluator.csproj            |  9 ++++
 lang/cs/build.props                             |  3 +-
 5 files changed, 49 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/e86b5b34/lang/cs/Org.Apache.REEF.Bridge.JAR/Org.Apache.REEF.Bridge.JAR.csproj
----------------------------------------------------------------------
diff --git 
a/lang/cs/Org.Apache.REEF.Bridge.JAR/Org.Apache.REEF.Bridge.JAR.csproj 
b/lang/cs/Org.Apache.REEF.Bridge.JAR/Org.Apache.REEF.Bridge.JAR.csproj
index 180858a..560ab96 100644
--- a/lang/cs/Org.Apache.REEF.Bridge.JAR/Org.Apache.REEF.Bridge.JAR.csproj
+++ b/lang/cs/Org.Apache.REEF.Bridge.JAR/Org.Apache.REEF.Bridge.JAR.csproj
@@ -54,7 +54,9 @@ under the License.
   <!--
     Executes 'mvn install', if the JAR does not exist.
   -->
-  <Target Name="Build" 
DependsOnTargets="CheckMavenInstall;CheckJavaInstall;CheckProtocInstall">
+  <Target Name="Build" 
+          
DependsOnTargets="CheckMavenInstall;CheckJavaInstall;CheckProtocInstall" 
+          Outputs="$(OutputPath)">
     <PropertyGroup>
       <!--The shaded jar of the bridge -->
       
<Bridge_JAR_Name>reef-bridge-java-$(REEF_Version)-shaded.jar</Bridge_JAR_Name>
@@ -78,24 +80,37 @@ under the License.
   <!--
     Standard Rebuild target: Clean, then build
   -->
-  <Target Name="Rebuild" DependsOnTargets="Clean;Build" />
-  <Target Name="CheckPrerequisites" DependsOnTargets="Build" />
-  <Target Name="BuildPackage" Condition="'$(BuildPackage)' == 'true'" 
DependsOnTargets="ExtractPOMVersion; CheckPrerequisites; FinalizeNuspecFiles" 
AfterTargets="Build">
-    <PropertyGroup>
-      <BuildCommand>$(NuGetCommand) pack "$(FinalizedNuspecFile)" -BasePath 
$(NugetProjectPath) -Properties 
"Configuration=$(Configuration);Platform=$(Platform);REEF_Version=$(REEF_Version)"
 $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" </BuildCommand>
-    </PropertyGroup>
-    <Exec Command="$(BuildCommand)" Condition=" '$(OS)' != 'Windows_NT' " />
-    <Exec Command="$(BuildCommand)" LogStandardErrorAsError="true" Condition=" 
'$(OS)' == 'Windows_NT' " />
-  </Target>
-  <Target Name="PushPackages" Condition="'$(PushPackages)' == 'true'" 
DependsOnTargets="BuildPackage" AfterTargets="BuildPackage">
-    <ItemGroup>
-      <PackageFile 
Include="$(SolutionDir).nuget\packages\$(RootNamespace).$(REEF_NugetVersion)$(SnapshotNumber).nupkg"
 />
-    </ItemGroup>
-    <PropertyGroup>
-      <PushCommand Condition="'$(NuGetApiKey)' == '' OR '$(NuGetApiKey)' == 
'*Undefined*'">$(NuGetCommand) push @(PackageFile) -Source 
$(NuGetRepository)</PushCommand>
-      <PushCommand Condition="'$(NuGetApiKey)' != '' AND '$(NuGetApiKey)' != 
'*Undefined*'">$(NuGetCommand) push @(PackageFile) $(NuGetApiKey) -Source 
$(NuGetRepository)</PushCommand>
-    </PropertyGroup>
-    <Exec Condition="'$(BuildPackage)' == 'true'" Command="$(PushCommand)" 
LogStandardErrorAsError="true">
-    </Exec>
-  </Target>
+  <Target Name="Rebuild" DependsOnTargets="Clean;Build"/>
+  <Target Name="CheckPrerequisites" DependsOnTargets="Build"/>
+    <Target Name="BuildPackage" Condition="'$(BuildPackage)' == 'true'" 
DependsOnTargets="ExtractPOMVersion; CheckPrerequisites; FinalizeNuspecFiles" 
AfterTargets="Build">
+        <PropertyGroup>
+            <BuildCommand>$(NuGetCommand) pack "$(FinalizedNuspecFile)" 
-BasePath $(NugetProjectPath) -Properties 
"Configuration=$(Configuration);Platform=$(Platform);REEF_Version=$(REEF_Version)"
 $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" </BuildCommand>
+            
<ReefVer>$([System.String]::Copy('$(REEF_NugetVersion)').Replace('-SNAPSHOT-',''))</ReefVer>
+        </PropertyGroup>
+  <ItemGroup>
+    <Line Include="line01"><Text>param($installPath, $toolsPath, $package, 
$project)</Text></Line>
+    <Line Include="line02"><Text>$file1 = 
$project.ProjectItems.Item("reef-bridge-java-$(ReefVer)-incubating-SNAPSHOT-shaded.jar")</Text></Line>
+    <Line Include="line03"><Text>$copyToOutput1 = 
$file1.Properties.Item("CopyToOutputDirectory")</Text></Line>
+    <Line Include="line04"><Text>$copyToOutput1.Value = 2</Text></Line>
+    <LineText Include="%(Line.Text)" />
+  </ItemGroup>
+  <WriteLinesToFile
+     
File="$(SolutionDir)\bin\$(Platform)\$(Configuration)\$(AssemblyName)\install.ps1"
+     Lines="@(LineText)"
+     Overwrite="true"
+     />
+        <Exec Command="$(BuildCommand)" Condition=" '$(OS)' != 'Windows_NT' " 
/>
+        <Exec Command="$(BuildCommand)" LogStandardErrorAsError="true" 
Condition=" '$(OS)' == 'Windows_NT' " />
+    </Target>
+    <Target Name="PushPackages" Condition="'$(PushPackages)' == 'true'" 
DependsOnTargets="BuildPackage"  AfterTargets="BuildPackage">
+        <ItemGroup>
+            <PackageFile 
Include="$(SolutionDir).nuget\packages\$(RootNamespace).$(REEF_NugetVersion)$(SnapshotNumber).nupkg"
 />
+        </ItemGroup>
+        <PropertyGroup>
+            <PushCommand Condition="'$(NuGetApiKey)' == '' OR '$(NuGetApiKey)' 
== '*Undefined*'">$(NuGetCommand) push @(PackageFile) -Source 
$(NuGetRepository)</PushCommand>
+            <PushCommand Condition="'$(NuGetApiKey)' != '' AND 
'$(NuGetApiKey)' != '*Undefined*'">$(NuGetCommand) push @(PackageFile) 
$(NuGetApiKey) -Source $(NuGetRepository)</PushCommand>
+        </PropertyGroup>
+       <Exec Condition="'$(BuildPackage)' == 'true'" Command="$(PushCommand)" 
LogStandardErrorAsError="true">
+        </Exec>
+    </Target>
 </Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/e86b5b34/lang/cs/Org.Apache.REEF.Bridge.JAR/Org.Apache.REEF.Bridge.JAR.nuspec
----------------------------------------------------------------------
diff --git 
a/lang/cs/Org.Apache.REEF.Bridge.JAR/Org.Apache.REEF.Bridge.JAR.nuspec 
b/lang/cs/Org.Apache.REEF.Bridge.JAR/Org.Apache.REEF.Bridge.JAR.nuspec
index 023c038..c5c5131 100644
--- a/lang/cs/Org.Apache.REEF.Bridge.JAR/Org.Apache.REEF.Bridge.JAR.nuspec
+++ b/lang/cs/Org.Apache.REEF.Bridge.JAR/Org.Apache.REEF.Bridge.JAR.nuspec
@@ -30,5 +30,6 @@ under the License.
   </metadata>
   <files>
       <file 
src="..\bin\$Platform$\$Configuration$\Org.Apache.REEF.Bridge.JAR\reef-bridge-java-$REEF_Version$-shaded.jar"
 target="content" />
+         <file 
src="..\bin\$Platform$\$Configuration$\Org.Apache.REEF.Bridge.JAR\install.ps1" 
target="tools" />
   </files>
 </package>

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/e86b5b34/lang/cs/Org.Apache.REEF.Client/Org.Apache.REEF.Client.csproj
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Client/Org.Apache.REEF.Client.csproj 
b/lang/cs/Org.Apache.REEF.Client/Org.Apache.REEF.Client.csproj
index eb9f995..c3c94d9 100644
--- a/lang/cs/Org.Apache.REEF.Client/Org.Apache.REEF.Client.csproj
+++ b/lang/cs/Org.Apache.REEF.Client/Org.Apache.REEF.Client.csproj
@@ -17,6 +17,7 @@ under the License.
 -->
 <Project ToolsVersion="12.0" DefaultTargets="Build" 
xmlns="http://schemas.microsoft.com/developer/msbuild/2003";>
   <Import 
Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
 
Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"
 />
+  <Import Project="$(SolutionDir)\build.props" />
   <PropertyGroup>
     <ProjectGuid>{5094C35B-4FDB-4322-AC05-45D684501CBF}</ProjectGuid>
     <OutputType>Exe</OutputType>
@@ -28,7 +29,6 @@ under the License.
     <RestorePackages>true</RestorePackages>
     <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == 
'*Undefined*'">..</SolutionDir>
   </PropertyGroup>
-  <Import Project="$(SolutionDir)\build.props" />
   <PropertyGroup>
     <BuildPackage>false</BuildPackage>
   </PropertyGroup>

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/e86b5b34/lang/cs/Org.Apache.REEF.Evaluator/Org.Apache.REEF.Evaluator.csproj
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Evaluator/Org.Apache.REEF.Evaluator.csproj 
b/lang/cs/Org.Apache.REEF.Evaluator/Org.Apache.REEF.Evaluator.csproj
index 577c1d9..1e23d5d 100644
--- a/lang/cs/Org.Apache.REEF.Evaluator/Org.Apache.REEF.Evaluator.csproj
+++ b/lang/cs/Org.Apache.REEF.Evaluator/Org.Apache.REEF.Evaluator.csproj
@@ -29,6 +29,15 @@ under the License.
     <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == 
'*Undefined*'">..</SolutionDir>
     <RestorePackages>true</RestorePackages>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <PlatformTarget>x64</PlatformTarget>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <Prefer32Bit>false</Prefer32Bit>
+    <PlatformTarget>x64</PlatformTarget>
+  </PropertyGroup>
   <Import Project="$(SolutionDir)\build.props" />
   <ItemGroup>
     <Reference Include="protobuf-net">

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/e86b5b34/lang/cs/build.props
----------------------------------------------------------------------
diff --git a/lang/cs/build.props b/lang/cs/build.props
index acb37aa..99b870d 100644
--- a/lang/cs/build.props
+++ b/lang/cs/build.props
@@ -18,10 +18,11 @@ under the License.
 <Project InitialTargets="ExtractPOMVersion" ToolsVersion="12.0" 
xmlns="http://schemas.microsoft.com/developer/msbuild/2003";>
   <!-- Common build paths -->
   <PropertyGroup>
+    <Prefer32Bit>false</Prefer32Bit>
+    <PlatformTarget>x64</PlatformTarget>
     <BinDir Condition="$(BinDir) == '' Or $(BinDir) == 
'*Undefined*'">$(SolutionDir)\bin</BinDir>
     <PackagesDir Condition="$(PackagesDir) == '' Or $(PackagesDir) == 
'*Undefined*'">$(SolutionDir)\packages</PackagesDir>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">x64</Platform>
   </PropertyGroup>
 
   <!-- Common build configurations -->

Reply via email to