Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
language: c
sudo: required
dist: trusty
before_install:
- sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu/ trusty main universe"
- sudo apt-get update -qq
- sudo apt-get install libgcrypt20 liblzma5 libselinux1
- wget "http://archive.ubuntu.com/ubuntu/ubuntu/pool/main/s/systemd/libsystemd0_219-7ubuntu3_amd64.deb"
- wget "http://archive.ubuntu.com/ubuntu/ubuntu/pool/main/s/systemd/libsystemd-dev_219-7ubuntu3_amd64.deb"
- sudo dpkg -i libsystemd0_219-7ubuntu3_amd64.deb libsystemd-dev_219-7ubuntu3_amd64.deb
services: docker
install:
- wget https://raw.githubusercontent.com/ocaml/ocaml-travisci-skeleton/master/.travis-opam.sh
- wget https://raw.githubusercontent.com/ocaml/ocaml-travisci-skeleton/master/.travis-docker.sh
script:
- cp xen-api-sdk.opam opam && ulimit -s 16384 && bash -ex .travis-opam.sh
- ulimit -s unlimited && bash -ex .travis-docker.sh
env:
global:
- OCAML_VERSION=4.04
- OCAML_VERSION=4.04.2
- PACKAGE=xen-api-sdk
- DISTRO="debian-stable"
- TESTS=false
- INSTALL=false
matrix:
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ java: build
cp java/LICENSE.Apache-2.0.txt _build/default/java/autogen

powershell: build
mkdir -p _build/default/powershell/autogen/src
mkdir -p _build/default/powershell/autogen/src/Properties
mkdir -p _build/default/powershell/autogen/samples
_build/default/powershell/gen_powershell_binding.exe -d _build/default/powershell/autogen
_build/default/powershell/gen_powershell_binding.exe -d _build/default/powershell/autogen/src -t powershell/templates
#source
mv _build/default/powershell/autogen/*.cs _build/default/powershell/autogen/src
cp powershell/src/*.cs _build/default/powershell/autogen/src
sed -i -e 's/1\.0\.0\.0/$(SDK_VERSION)/g' -e 's/1000/$(SDK_VERSION).0/g' _build/default/powershell/autogen/src/AssemblyInfo.cs
mv _build/default/powershell/autogen/src/AssemblyInfo.cs _build/default/powershell/autogen/src/Properties/AssemblyInfo.cs
sed -i -e 's/1\.0\.0\.0/$(SDK_VERSION)/g' -e 's/1000/$(SDK_VERSION).0/g' _build/default/powershell/autogen/src/Properties/AssemblyInfo.cs
#samples
cp powershell/samples/*.ps1 _build/default/powershell/autogen/samples
#other
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# XenAPI Software Development Kit

[![Build Status](https://travis-ci.org/xapi-project/xen-api-sdk.svg?branch=master)](https://travis-ci.org/xapi-project/xen-api-sdk)
[![Lines of Code](https://tokei.rs/b1/github/xapi-project/xen-api-sdk)](https://github.com/xapi-project/xen-api-sdk)

This repository contains the generation code for the XenAPI Software Development
Kit (SDK) and its associated documentation and examples.

Expand All @@ -16,8 +19,8 @@ The generation code is written in [OCaml][1].
Install [opam][2]. It is also recommended to install one of the listed external
solvers (e.g. aspcud).

Ensure you are using version 4.02.3 of the OCaml compiler:
`opam switch 4.02.3`
Ensure you are using version 4.04.2 of the OCaml compiler:
`opam switch 4.04.2`

and you have the package depext: `opam install depext`

Expand Down
7 changes: 7 additions & 0 deletions common/CommonFunctions.ml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ open Printf
open Datamodel_types


let with_output filename f =
let io = open_out filename in
finally
(fun () -> f io)
(fun () -> close_out io)


let rec list_distinct list =
match list with
| [] -> []
Expand Down
30 changes: 11 additions & 19 deletions csharp/templates/XenServer.csproj.mustache
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{83EAC000-F729-475D-AC1D-90DC0791DE8E}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>XenAPI</RootNamespace>
<AssemblyName>XenServer</AssemblyName>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -38,15 +30,16 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="CookComputing.XmlRpcV2.dll">
<Reference Include="CookComputing.XmlRpcV2">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\CookComputing.XmlRpcV2.dll</HintPath>
<HintPath>.\CookComputing.XmlRpcV2.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
{{#api_members}}
<Compile Include="{{api_member}}.cs" />
{{/api_members}}
Expand All @@ -55,17 +48,11 @@
<Compile Include="EventHelpers.cs" />
<Compile Include="DeprecatedAttribute.cs" />
<Compile Include="Failure.cs" />
<Compile Include="FriendlyErrorNames.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>FriendlyErrorNames.resx</DependentUpon>
</Compile>
<Compile Include="Helper.cs" />
<Compile Include="HTTP.cs" />
<Compile Include="IMockWebProxy.cs" />
<Compile Include="IXenObject.cs" />
<Compile Include="Marshalling.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Response.cs" />
<Compile Include="Session.cs" />
<Compile Include="Subject2.cs" />
Expand All @@ -76,6 +63,11 @@
<Compile Include="HTTP_actions.cs" />
<Compile Include="Proxy.cs" />
<Compile Include="Maps.cs" />
<Compile Include="FriendlyErrorNames.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>FriendlyErrorNames.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="FriendlyErrorNames.resx">
Expand All @@ -85,8 +77,8 @@
<LastGenOutput>FriendlyErrorNames.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
Expand Down
20 changes: 19 additions & 1 deletion powershell/README.dist
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@ LICENSE.CookComputing.XmlRpcV2.txt for details. The library
(CookComputing.XmlRpcV2.dll) is shipped with the XenServer PowerShell Module.


Folder structure
Folder Structure
----------------

The XenServer-SDK-@SDK_VERSION@.zip contains the following folders that are
relevant to PowerShell users:

- XenServerPowerShell\XenServerPSModule: this is the XenServer PowerShell Module
- XenServerPowerShell\src: contains the C# source code for the XenServer cmdlets
shipped as a Visual Studio project.
- XenServerPowerShell\samples: contains the sample scripts accompanying the module.


Expand Down Expand Up @@ -124,3 +125,20 @@ Getting Started
PS> Connect-XenServer -Url https://<servername>
PS> Get-XenVM
PS> Disconnect-XenServer


Building and Debugging the Source Code
--------------------------------------

1. Copy CookComputing.XmlRpcV2.dll and XenServer.dll from the XenServerPSModule
folder into the source code folder at the same level as the
XenServerPowerShell.csproj file.

2. Open the project XenServerPowerShell.csproj in Visual Studio (2013 or greater).

3. You should now be ready to build the source code.

4. If in Debug mode, clicking Start will launch a PowerShell prompt as an
external process, and import the compiled XenServerPowerShell.dll as a module
(without, however, processing the scripts, types, and formats shipped within
the XenServerPSModule). You should now be ready to debug the cmdlets.
Loading