Skip to content
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The samples included in this repository best convey the simplicity and value of

- [Simple NuGet Dependency Sample](Samples/SimpleNuGetDependency.Unity/README.md) - Showcases the simplest and most minimal usage of this component to pull in a dependency.
- [Integrated Dependencies Sample](Samples/IntegratedDependencies.Unity/README.md) - Showcases the power of this component by relying on project generation.
- [Cross Unity Dependencies Sample](Samples/CrossUnityDependencies.Unity/README.md) - Showcases how to establish a dependency between two Unity projects (almost like AsmDef-to-AsmDef).

### Builds and Packages

Expand Down
70 changes: 70 additions & 0 deletions Samples/CrossUnityDependencies.Unity/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# This .gitignore file should be placed at the root of your Unity project directory
#
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
#
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
/[Mm]emoryCaptures/

# Never ignore Asset meta data
!/[Aa]ssets/**/*.meta

# Uncomment this line if you wish to ignore the asset store tools plugin
# /[Aa]ssets/AssetStoreTools*

# Autogenerated Jetbrains Rider plugin
[Aa]ssets/Plugins/Editor/JetBrains*

# Visual Studio cache directory
.vs/

# Gradle cache directory
.gradle/

# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb
*.mdb
*.opendb
*.VC.db

# Unity3D generated meta files
*.pidb.meta
*.pdb.meta
*.mdb.meta

# Unity3D generated file on crash reports
sysinfo.txt

# Builds
*.apk
*.unitypackage

# Crashlytics generated file
crashlytics-build.properties

# Custom MSBuildForUnity Project Related ignore entries
/MSBuild/*
!/MSBuild/Publish/
!/MSBuild/settings.json
/MSBuild/Publish/**/*.dll
/MSBuild/Publish/**/*.pdb
/MSBuildForUnity.Common.props
!/Assets/**/*.msb4u.*
!/Packages/**/*.msb4u.*
/Assets/Dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<Project ToolsVersion="15.0">
<!--GENERATED FILE-->
<!--
This file can be modified and checked in as long as the following rules are met:
- Both the imports are present:
- - <Import Project="$(MSBuildProjectName).g.props" />
- - <Import Project="$(MSBuildProjectName).g.targets" />
- Nothing above the props import or below the targets import is modified
- No C# source files are added for compilation

You can modify this file as follows:
- Add NuGet package references:
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />
</ItemGroup>
- Add external C# project references:
<ItemGroup>
<ProjectReference Include="..\..\..\ExternalLib\ExternalLib.csproj" />
</ItemGroup>
-->

<Import Project="$([MSBuild]::GetPathOfFileAbove(MSBuildForUnity.Common.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(MSBuildForUnity.Common.props))')" />
<PropertyGroup>
<!--anborod: This is a weird thing, it is a required property (even if commented)-->
<!--<TargetFrameworks>netstandard2.0;uap10.0;net46</TargetFrameworks> -->
</PropertyGroup>

<!-- SDK.props is imported inside this props file -->
<Import Project="$(MSBuildForUnityGeneratedProjectDirectory)\$(MSBuildProjectName).g.props" />

<ItemGroup>
<!-- Add your references here -->
<!-- This reference to a separate Unity project should also be placed in Dependencies.msb4u.csproj. -->
<ProjectReference Include="..\..\IntegratedDependencies.Unity\Assets\GeneralComponent\GeneralComponent.msb4u.csproj"/>
</ItemGroup>

<!-- SDK.targets is imported inside this props file -->
<Import Project="$(MSBuildForUnityGeneratedProjectDirectory)\$(MSBuildProjectName).g.targets" />
</Project>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using UnityEngine;

public class CrossUnityTestScript : MonoBehaviour
{
private GeneralComponentType generalComponentType = new GeneralComponentType();

private void Start()
{
Debug.Log(generalComponentType.GetThisDataToo());
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Samples/CrossUnityDependencies.Unity/Assets/Dependencies.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<Project ToolsVersion="15.0">
<!--GENERATED FILE-->
<!--
This file can be modified and checked in.

It is different from the other generated C# Projects in that it will be the one gathering all dependencies and placing them into the Unity asset folder.

You can add project level dependencies to this file, by placing them below:
- <Import Project="$(MSBuildForUnityGeneratedProjectDirectory)\$(MSBuildProjectName).g.props" />
and before:
- <Import Project="$(MSBuildForUnityGeneratedProjectDirectory)\$(MSBuildProjectName).g.targets" />

Do not add any source or compliation items.

Examples of how you can modify this file:
- Add NuGet package references:
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />
</ItemGroup>
- Add external C# project references:
<ItemGroup>
<ProjectReference Include="..\..\..\ExternalLib\ExternalLib.csproj" />
</ItemGroup>
-->
Copy link
Contributor

@chrisfromwork chrisfromwork Jan 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you think we benefit from having this much content in all generated files? It kind of seems like if I was only shown a reference example this file would be less intimidating for someone new to csproj definitions. #WontFix

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reducing the amount of content in this file will make it easier to read in things like notepad


In reply to: 367709527 [](ancestors = 367709527)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will keep it for now, but will consider it in the future.


In reply to: 367709703 [](ancestors = 367709703,367709527)


<Import Project="$([MSBuild]::GetPathOfFileAbove(MSBuildForUnity.Common.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(MSBuildForUnity.Common.props))')" />

<PropertyGroup>
<!--anborod: This is a weird thing, it is a required property (even if commented)-->
<!--<TargetFrameworks>netstandard2.0;uap10.0;net46</TargetFrameworks> -->
</PropertyGroup>

<!-- SDK.props is imported inside this props file -->
<Import Project="$(MSBuildForUnityGeneratedProjectDirectory)\$(MSBuildProjectName).g.props" />

<ItemGroup>
<!-- Add your references here -->
<ProjectReference Include="..\..\IntegratedDependencies.Unity\Assets\GeneralComponent\GeneralComponent.msb4u.csproj" />
</ItemGroup>

<!-- SDK.targets is imported inside this props file -->
<Import Project="$(MSBuildForUnityGeneratedProjectDirectory)\$(MSBuildProjectName).g.targets" />
</Project>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Samples/CrossUnityDependencies.Unity/Assets/Scenes.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading