Skip to content

Commit a1b59a1

Browse files
committed
Setup SwiftBindings project
1 parent 75f92b1 commit a1b59a1

12 files changed

+29
-81
lines changed

Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<!-- Set this property to false if you don't want to use the runtime
1414
framework version defined in Versions.props -->
15-
<UseCustomRuntimeVersion>true</UseCustomRuntimeVersion>
15+
<UseCustomRuntimeVersion>false</UseCustomRuntimeVersion>
1616
<RuntimeFrameworkVersion Condition="$(UseCustomRuntimeVersion)">$(MicrosoftNETCoreAppVersion)</RuntimeFrameworkVersion>
1717
</PropertyGroup>
1818

README.md

+4-31
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,10 @@
1-
# Standalone Experiments
1+
# Swift Bindings
22

3-
This branch contains a template for standalone experiments, which means that experiments that are a library, which doesn't depend on runtime changes. This minimal template allows such experiments to avoid the overhead of having all the runtime, libraries and installer code.
3+
This is a collection of tools designed to consume a compiled Apple Swift library and generate bindings and wrappers that enable it to be used as a .NET library.
44

5-
## Create your experiment
5+
## Current Status
66

7-
1. Create a new branch from this branch and make sure the branch name follows the naming guidelines to get CI and Official Build support. The name should use the `feature/` prefix.
8-
9-
2. Identify whether you need to consume new APIs or features from `dotnet/runtime` and need to be able to consume these on a faster cadence than using a daily SDK build:
10-
- I don't need to depend on `dotnet/runtime`:
11-
1. Update the `global.json` file:
12-
- Specify the minimum required `dotnet` tool and SDK version that you need to build and run tests
13-
- Remove the `runtimes` section under `tools`
14-
2. Set `UseCustomRuntimeVersion` property to `false` in `Directory.Build.props`
15-
3. Remove the `VS.Redist.Common.NetCore.SharedFramework.x64.6.0` dependency from `Version.Details.xml` and the corresponding property from `Version.props`
16-
- I do need to depend on `dotnet/runtime`:
17-
1. Set a DARC dependency from `dotnet/runtime` to your branch in this repository. For more information on how to do it, see [here](https://github.com/dotnet/arcade/blob/main/Documentation/Darc.md#darc)
18-
19-
20-
> Note that if you want to run `dotnet test` in you test projects you will need to either first run `build.cmd/sh` or install the runtime version specified by `MicrosoftNETCoreAppVersion` property in `Versions.props` in your global dotnet install. If you run `build.cmd/sh` arcade infrastructure will make sure that the repo `dotnet` SDK found in `<RepoRoot>\.dotnet` folder, has this runtime installed. Then during the build of the test projects, we generate a `.runsettings` file that points to this `dotnet` SDK.
21-
22-
23-
> For both options above, you can choose whether your experiment needs arcade latest features, to do that, set the required DARC subscription from `dotnet/arcade` to this repository following these [instructions](https://github.com/dotnet/arcade/blob/main/Documentation/Darc.md#darc).
24-
25-
3. Set the right version for your library. In order to do that, set the following properties in `Versions.props`:
26-
- `VersionPrefix`: the version prefix for the produced nuget package.
27-
- `MajorVersion/MinorVersion/PatchVersion`: Properties that control file version.
28-
- `PreReleaseVersionLabel`: this is the label that your package will contain when producing a non stable package. i.e: `MyExperiment.1.0.0-alpha-23432.1.nupkg`.
29-
30-
4. Choose the right set of platforms for CI and Official Builds by tweaking `eng/pipelines/runtimelab.yml` file.
31-
32-
5. Rename `Experimental.sln`, `Experimental.csproj` and `Experimental.Tests.csproj` to your experiment name.
33-
34-
The package produced from your branch will be published to the the [`dotnet-experimental`](https://dev.azure.com/dnceng/public/_packaging?_a=feed&feed=dotnet-experimental) feed.
7+
The components are currently undergoing iterative reviews and will be moved from https://github.com/xamarin/binding-tools-for-swift.
358

369
## .NET Foundation
3710

eng/Version.Details.xml

-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Dependencies>
3-
<ProductDependencies>
4-
<!-- This VS redist package is used as a way to get a non-shipping version number
5-
when using a custom runtime version. -->
6-
<Dependency Name="VS.Redist.Common.NetCore.SharedFramework.x64.6.0" Version="6.0.0-preview.5.21226.5">
7-
<Uri>https://github.com/dotnet/runtime</Uri>
8-
<Sha>ac82799250fe42c8ba2941aef487aca94ecf04cc</Sha>
9-
</Dependency>
10-
</ProductDependencies>
113
<ToolsetDependencies>
124
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.24102.4">
135
<Uri>https://github.com/dotnet/arcade</Uri>

eng/Versions.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
33
<PropertyGroup>
4-
<!-- Experiment package versions properties -->
4+
<!-- SwiftBindings package versions properties -->
55
<VersionPrefix>1.0.0</VersionPrefix>
66
<!-- File version numbers -->
77
<MajorVersion>1</MajorVersion>

eng/pipelines/runtimelab.yml

+1-20
Original file line numberDiff line numberDiff line change
@@ -51,33 +51,14 @@ stages:
5151
jobs:
5252
- template: /eng/pipelines/templates/build-job.yml
5353
parameters:
54-
osGroup: Windows_NT
54+
osGroup: OSX
5555
archType: x64
5656
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
5757
isOfficialBuild: true
5858
runTests: false
59-
pool:
60-
name: NetCore1ESPool-Internal
61-
demands: ImageOverride -equals windows.vs2022preview.amd64
62-
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
63-
pool:
64-
vmImage: 'windows-latest'
65-
66-
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
67-
- template: /eng/pipelines/templates/build-job.yml
68-
parameters:
69-
osGroup: OSX
70-
archType: x64
7159
pool:
7260
vmImage: 'macOS-latest'
7361

74-
- template: /eng/pipelines/templates/build-job.yml
75-
parameters:
76-
osGroup: Linux
77-
archType: x64
78-
pool:
79-
vmImage: 'ubuntu-latest'
80-
8162
# Publish and validation steps. Only run in official builds
8263
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
8364
- template: \eng\common\templates\post-build\post-build.yml

global.json

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
{
22
"sdk": {
3-
"version": "9.0.100-alpha.1.23615.4",
3+
"version": "8.0.100",
44
"allowPrerelease": true,
55
"rollForward": "major"
66
},
77
"tools": {
8-
"dotnet": "9.0.100-alpha.1.23615.4",
9-
"runtimes": {
10-
"dotnet": [
11-
"$(MicrosoftNETCoreAppVersion)"
12-
]
13-
}
8+
"dotnet": "8.0.100"
149
},
1510
"msbuild-sdks": {
1611
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24102.4"

src/Experiment/src/MyClass.cs

-9
This file was deleted.

Experiment.sln src/SwiftBindings/SwiftBindings.sln

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
44
VisualStudioVersion = 15.0.26124.0
55
MinimumVisualStudioVersion = 15.0.26124.0
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Experiment", "src\Experiment\src\Experiment.csproj", "{B7977360-6671-4707-9A1C-1C29D5BE2674}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SwiftBindings", "src\SwiftBindings.csproj", "{B7977360-6671-4707-9A1C-1C29D5BE2674}"
77
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Experiment.Tests", "src\Experiment\tests\Experiment.Tests.csproj", "{CE81B6BD-CCCC-4223-9069-B28435A4A5C1}"
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SwiftBindings.Tests", "tests\SwiftBindings.Tests.csproj", "{CE81B6BD-CCCC-4223-9069-B28435A4A5C1}"
99
EndProject
1010
Global
1111
GlobalSection(SolutionConfigurationPlatforms) = preSolution

src/SwiftBindings/src/MyClass.cs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System;
2+
3+
namespace SwiftBindings
4+
{
5+
public class MyClass
6+
{
7+
public static bool ReturnTrue => true;
8+
public static void Main(string[] args)
9+
{
10+
Console.WriteLine("Hello World!");
11+
}
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
45
<TargetFramework>net8.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
58
</PropertyGroup>
69

710
</Project>

src/Experiment/tests/MyClassTests.cs src/SwiftBindings/tests/SmokeTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using Xunit;
33

4-
namespace Experiment.Tests
4+
namespace SwiftBindings.Tests
55
{
66
public class MyClassTests
77
{

src/Experiment/tests/Experiment.Tests.csproj src/SwiftBindings/tests/SwiftBindings.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
</PropertyGroup>
55

66
<ItemGroup>
7-
<ProjectReference Include="..\src\Experiment.csproj" />
7+
<ProjectReference Include="..\src\SwiftBindings.csproj" />
88
</ItemGroup>
99
</Project>

0 commit comments

Comments
 (0)