You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2015/12/03 14:09:32 UTC

[17/22] ignite git commit: wip Jars management

wip Jars management


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

Branch: refs/heads/ignite-1626
Commit: c653f660e1db218fa6701173d362418b869235f9
Parents: 3a33d4b
Author: Pavel Tupitsyn <pt...@gridgain.com>
Authored: Mon Nov 16 11:30:16 2015 +0300
Committer: Pavel Tupitsyn <pt...@gridgain.com>
Committed: Mon Nov 16 11:30:16 2015 +0300

----------------------------------------------------------------------
 .../Apache.Ignite.Core.csproj                   |  3 +-
 .../Apache.Ignite.Core.nuspec                   | 12 ++++--
 .../Apache.Ignite.Core.nuspec.Install.ps1       | 34 ---------------
 .../dotnet/Apache.Ignite.Core/NuGet/Install.ps1 | 44 ++++++++++++++++++++
 .../Apache.Ignite.Core/NuGet/PostBuild.ps1      | 20 +++++++++
 5 files changed, 74 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c653f660/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
index f9bf93b..6755e90 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
@@ -369,7 +369,8 @@
   </ItemGroup>
   <ItemGroup>
     <None Include="Apache.Ignite.Core.nuspec" />
-    <None Include="Apache.Ignite.Core.nuspec.Install.ps1" />
+    <None Include="NuGet\PostBuild.ps1" />
+    <None Include="NuGet\Install.ps1" />
     <None Include="Apache.Ignite.Core.snk" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/c653f660/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.nuspec
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.nuspec b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.nuspec
index e24a4a3..5ea57ef 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.nuspec
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.nuspec
@@ -55,13 +55,17 @@ Creating NuGet package:
         <!--<file src="bin\x64\Release\*.dll" target="lib\net40" />-->
         
         <!-- Install script should be in tools -->
-        <file src="Apache.Ignite.Core.nuspec.Install.ps1" target="tools\Install.ps1" />
+        <file src="NuGet\Install.ps1" target="tools" />
         
         <!-- Other files should go to Content folder to be automatically included in project. -->
         <file src="..\..\..\..\config\default-config.xml" target="Content\Config" />
         
-        <file src="..\..\..\..\target\release-package\libs\*.jar" target="Content\Libs" />
-        <file src="..\..\..\..\target\release-package\libs\ignite-spring\*.jar" target="Content\Libs" />
-        <file src="..\..\..\..\target\release-package\libs\ignite-indexing\*.jar" target="Content\Libs" />
+        <!-- 
+            Library files (jars) should not be included in project, so that NuGet package restore works properly.
+            We keep jars in NuGet dir and copy them over in PostBuild event.
+        -->
+        <file src="..\..\..\..\target\release-package\libs\*.jar" target="Jars" />
+        <file src="..\..\..\..\target\release-package\libs\ignite-spring\*.jar" target="Jars" />
+        <file src="..\..\..\..\target\release-package\libs\ignite-indexing\*.jar" target="Jars" />
     </files>
 </package>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/c653f660/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.nuspec.Install.ps1
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.nuspec.Install.ps1 b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.nuspec.Install.ps1
deleted file mode 100644
index 5da22e7..0000000
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.nuspec.Install.ps1
+++ /dev/null
@@ -1,34 +0,0 @@
-#    Licensed under the Apache License, Version 2.0 (the "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
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS,
-#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#    See the License for the specific language governing permissions and
-#    limitations under the License.
-
-param($installPath, $toolsPath, $package, $project)
-
-Write-Host "Updating content files properties..."
-
-Function SetProperties
-{
-    param ($projItem)
-    
-    Write-Host $projItem.Name 
-
-    $projItem.Properties.Item("CopyToOutputDirectory").Value = 2  # copy if newer
-}
-
-SetProperties $project.ProjectItems.Item("Config").ProjectItems.Item("default-config.xml")
-
-ForEach ($item in $project.ProjectItems.Item("Libs").ProjectItems) 
-{
-    SetProperties $item
-}
-
-
-Write-Host "Welcome to Apache Ignite.NET!"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/c653f660/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/Install.ps1
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/Install.ps1 b/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/Install.ps1
new file mode 100644
index 0000000..96e73d0
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/Install.ps1
@@ -0,0 +1,44 @@
+#    Licensed under the Apache License, Version 2.0 (the "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
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+
+param($installPath, $toolsPath, $package, $project)
+
+Write-Host "Updating project properties..."
+
+Function SetProperties
+{
+    param ($projItem)
+    
+    Write-Host $projItem.Name 
+
+    $projItem.Properties.Item("CopyToOutputDirectory").Value = 2  # copy if newer
+}
+
+# Copy default config to output dir for user conveniece
+SetProperties $project.ProjectItems.Item("Config").ProjectItems.Item("default-config.xml")
+
+# ForEach ($item in $project.ProjectItems.Item("Libs").ProjectItems) 
+# {
+#    SetProperties $item
+# }
+
+. (Join-Path $toolsPath "GetSqlCEPostBuildCmd.ps1")
+
+# Get the current Post Build Event cmd
+$currentPostBuildCmd = $project.Properties.Item("PostBuildEvent").Value
+
+# Append our post build command if it's not already there
+if (!$currentPostBuildCmd.Contains($IgnitePostBuildCmd)) {
+    $project.Properties.Item("PostBuildEvent").Value += $IgnitePostBuildCmd
+}
+
+Write-Host "Welcome to Apache Ignite.NET!"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/c653f660/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/PostBuild.ps1
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/PostBuild.ps1 b/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/PostBuild.ps1
new file mode 100644
index 0000000..99ecd52
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/NuGet/PostBuild.ps1
@@ -0,0 +1,20 @@
+#    Licensed under the Apache License, Version 2.0 (the "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
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+
+$solutionDir = [System.IO.Path]::GetDirectoryName($dte.Solution.FullName) + "\"
+$path = $installPath.Replace($solutionDir, "`$(SolutionDir)")
+
+$Jars = Join-Path $path "Jars\*.*"
+
+$IgnitePostBuildCmd = "
+if not exist `"`$(TargetDir)Jars`" md `"`$(TargetDir)Jars`"
+xcopy /s /y `"$Jars`" `"`$(TargetDir)Jars`""
\ No newline at end of file