Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit f0f12c6

Browse files
Merge pull request #875 from github-for-unity/use-local-zips-when-developing
Use local zips when developing
2 parents 0e1bdff + 362ec6c commit f0f12c6

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

src/GitHub.Api/GitHub.Api.csproj

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,25 @@
295295
Other similar extension points exist, see Microsoft.Common.targets.
296296
<Target Name="BeforeBuild">
297297
</Target>
298+
-->
298299
<Target Name="AfterBuild">
300+
<Copy
301+
SourceFiles="PlatformResources\linux\git-lfs.zip;PlatformResources\linux\git-lfs.json"
302+
DestinationFolder="$(SolutionDir)\src\UnityExtension\Assets\Editor\GitHub.Unity\PlatformResources\linux"
303+
SkipUnchangedFiles="true"
304+
/>
305+
306+
<Copy
307+
SourceFiles="PlatformResources\mac\git-lfs.zip;PlatformResources\mac\git-lfs.json"
308+
DestinationFolder="$(SolutionDir)\src\UnityExtension\Assets\Editor\GitHub.Unity\PlatformResources\mac"
309+
SkipUnchangedFiles="true"
310+
/>
311+
312+
<Copy
313+
SourceFiles="PlatformResources\windows\git.zip;PlatformResources\windows\git.json;PlatformResources\windows\git-lfs.zip;PlatformResources\windows\git-lfs.json"
314+
DestinationFolder="$(SolutionDir)\src\UnityExtension\Assets\Editor\GitHub.Unity\PlatformResources\windows"
315+
SkipUnchangedFiles="true"
316+
/>
299317
</Target>
300-
-->
301318
<Import Project="..\..\common\build.targets" />
302319
</Project>

src/GitHub.Api/Installer/GitInstaller.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,14 @@ public GitInstallationState SetupGitIfNeeded(GitInstallationState state = null)
5555
}
5656

5757
state = VerifyZipFiles(state);
58+
// on developer builds, prefer local zips over downloading
59+
#if DEVELOPER_BUILD
60+
state = GrabZipFromResourcesIfNeeded(state);
61+
state = GetZipsIfNeeded(state);
62+
#else
5863
state = GetZipsIfNeeded(state);
5964
state = GrabZipFromResourcesIfNeeded(state);
65+
#endif
6066
state = ExtractGit(state);
6167

6268
// if installing from zip failed (internet down maybe?), try to find a usable system git

src/UnityExtension/.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
*.csproj
22
UnityPackageManager
33
JetBrains
4-
UnityExtension.sln
4+
UnityExtension.sln
5+
Assets/**/*.zip
6+
Assets/**/*.md5
7+
Assets/**/*.json

0 commit comments

Comments
 (0)