Permalink
Browse files
[Assets] Switch from implicit project to explicit project if necessary (
- Loading branch information
|
@@ -274,6 +274,23 @@ public bool IsDirty |
|
|
[DataMemberIgnore] |
|
|
public string RootNamespace { get; private set; } |
|
|
|
|
|
[DataMemberIgnore] |
|
|
public bool IsImplicitProject |
|
|
{ |
|
|
get |
|
|
{ |
|
|
// To keep in sync with LoadProject() .csproj |
|
|
// Note: Meta is ignored since it is supposedly "read-only" from csproj |
|
|
return (AssetFolders.Count == 1 && AssetFolders.First().Path == "Assets" |
|
|
&& ResourceFolders.Count == 1 && ResourceFolders.First() == "Resources" |
|
|
&& OutputGroupDirectories.Count == 0 |
|
|
&& ExplicitFolders.Count == 0 |
|
|
&& Bundles.Count == 0 |
|
|
&& RootAssets.Count == 0 |
|
|
&& TemplateFolders.Count == 0); |
|
|
} |
|
|
} |
|
|
|
|
|
/// <summary> |
|
|
/// Adds an existing project to this package. |
|
|
/// </summary> |
|
|
|
@@ -385,6 +385,11 @@ private void DirectDependencies_CollectionChanged(object sender, NotifyCollectio |
|
|
|
|
|
protected override void SavePackage() |
|
|
{ |
|
|
// Check if our project is still implicit one |
|
|
// Note: we only allow transition from implicit to explicit (otherwise we would have to delete file, etc.) |
|
|
if (IsImplicitProject && Package.IsDirty && !Package.IsImplicitProject) |
|
|
IsImplicitProject = false; |
|
|
|
|
|
if (!IsImplicitProject) |
|
|
base.SavePackage(); |
|
|
} |
|
|
0 comments on commit
1813edc