Repository: incubator-reef
Updated Branches:
  refs/heads/REEF-224 [created] c7a69bd9e


[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)


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

Branch: refs/heads/REEF-224
Commit: c7a69bd9e265cbb2c2923588888ab16f6adc5da4
Parents: 6adfd88
Author: Beysim Sezgin <[email protected]>
Authored: Fri Mar 27 16:56:46 2015 -0700
Committer: Beysim Sezgin <[email protected]>
Committed: Fri Mar 27 16:56:46 2015 -0700

----------------------------------------------------------------------
 .../Org.Apache.REEF.Bridge.JAR.csproj           | 37 ++++++++++++++++----
 .../Org.Apache.REEF.Bridge.JAR.nuspec           |  1 +
 .../Org.Apache.REEF.Client.csproj               |  2 ++
 .../Org.Apache.REEF.Evaluator.csproj            |  9 +++++
 .../Org.Apache.REEF.Tests.csproj                |  2 +-
 5 files changed, 44 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c7a69bd9/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 7eb246c..c0e8a39 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
@@ -23,7 +23,7 @@ under the License.
     <RootNamespace>Org.Apache.REEF.Bridge.JAR</RootNamespace>
     <ProjectGuid>{62905C7C-1A7E-4923-B78D-1BF42D7FAD40}</ProjectGuid>
     <AssemblyName>Org.Apache.REEF.Bridge.JAR</AssemblyName>
-    <RestorePackages>true</RestorePackages>
+    <RestorePackages>true</RestorePackages>     
   </PropertyGroup>
   <Import Project="$(SolutionDir)\build.props" />
   <Import Project="$(SolutionDir)\.nuget\NuGet.targets" 
Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
@@ -55,7 +55,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>
@@ -84,8 +86,20 @@ under the License.
     <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="..\bin\$(Platform)\$(Configuration)\$(AssemblyName)\install.ps1"
+     Lines="@(LineText)"
+     Overwrite="true"
+     />
         <Exec Command="$(BuildCommand)"
               Condition=" '$(OS)' != 'Windows_NT' " />
 
@@ -93,16 +107,27 @@ under the License.
               LogStandardErrorAsError="true"
               Condition=" '$(OS)' == 'Windows_NT' " />
     </Target>
+    <Choose>
+        <When Condition="'$(SolutionDir)'=='..'">
+            <PropertyGroup>
+                <SolutionDir2>..\</SolutionDir2>
+            </PropertyGroup>
+        </When>
+        <Otherwise>
+            <PropertyGroup>
+                <SolutionDir2>$(SolutionDir)</SolutionDir2>
+            </PropertyGroup>
+        </Otherwise>
+    </Choose>
+
     <Target Name="PushPackages" Condition="'$(PushPackages)' == 'true'" 
DependsOnTargets="BuildPackage"  AfterTargets="BuildPackage">
         <ItemGroup>
-            <PackageFile 
Include="$(SolutionDir).nuget\packages\$(RootNamespace).$(REEF_NugetVersion)$(SnapshotNumber).nupkg"
 />
+            <PackageFile 
Include="$(SolutionDir2).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)"

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c7a69bd9/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 6b9cfeb..f0f18f9 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
@@ -14,5 +14,6 @@
   </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/c7a69bd9/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..00dab2e 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
@@ -26,6 +26,8 @@ under the License.
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <RestorePackages>true</RestorePackages>
+    <Prefer32Bit>false</Prefer32Bit>
+    <PlatformTarget>x64</PlatformTarget>
     <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == 
'*Undefined*'">..</SolutionDir>
   </PropertyGroup>
   <Import Project="$(SolutionDir)\build.props" />

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/c7a69bd9/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 d5cb312..7133794 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/c7a69bd9/lang/cs/Org.Apache.REEF.Tests/Org.Apache.REEF.Tests.csproj
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Tests/Org.Apache.REEF.Tests.csproj 
b/lang/cs/Org.Apache.REEF.Tests/Org.Apache.REEF.Tests.csproj
index 055b294..559d27a 100644
--- a/lang/cs/Org.Apache.REEF.Tests/Org.Apache.REEF.Tests.csproj
+++ b/lang/cs/Org.Apache.REEF.Tests/Org.Apache.REEF.Tests.csproj
@@ -129,7 +129,7 @@ under the License.
       <Name>Org.Apache.REEF.Bridge</Name>
     </ProjectReference>
   </ItemGroup>
-  <ItemGroup>
+    <ItemGroup>
     <Content 
Include="bin\reef-bridge-java-0.11.0-incubating-SNAPSHOT-shaded.jar">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>

Reply via email to