-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Initial dotnet formula #3691
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
class Dotnet < Formula | ||
desc ".Net Core" | ||
homepage "https://github.com/dotnet/cli/releases" | ||
url "https://github.com/dotnet/cli/archive/v1.0.0-preview2.tar.gz" | ||
sha256 "a0708ed3eedb10e95dcea96c62f85be1c38b91f2be9afa89d8fc655b7e0c4706" | ||
|
||
patch :DATA | ||
head "https://github.com/dotnet/cli.git" | ||
|
||
depends_on "cmake" => :build | ||
depends_on "openssl" | ||
|
||
def install | ||
system "./build.sh", "--targets", "Prepare,Compile" | ||
|
||
# Relink openssl to the homebrew version | ||
# Would be smoother to tell clang to use this openssl prefix, but alas... | ||
openssl_path = Formula["openssl"].opt_prefix | ||
|
||
stage2 = buildpath/"artifacts/osx.#{MacOS.version}-x64/stage2" | ||
system "install_name_tool -add_rpath #{openssl_path}/lib #{stage2}/shared/Microsoft.NETCore.App/1.0.0/System.Security.Cryptography.Native.dylib" | ||
|
||
prefix.install Dir["#{stage2}/*"] | ||
end | ||
|
||
test do | ||
system prefix/"dotnet", "version" | ||
end | ||
end | ||
__END__ | ||
--- | ||
build_projects/dotnet-cli-build/PrepareTargets.cs | 9 --------- | ||
build_projects/shared-build-targets-utils/Utils/GitUtils.cs | 4 ++-- | ||
2 files changed, 2 insertions(+), 11 deletions(-) | ||
|
||
diff --git a/build_projects/dotnet-cli-build/PrepareTargets.cs b/build_projects/dotnet-cli-build/PrepareTargets.cs | ||
index 5e6b948..3af853b 100644 | ||
--- a/build_projects/dotnet-cli-build/PrepareTargets.cs | ||
+++ b/build_projects/dotnet-cli-build/PrepareTargets.cs | ||
@@ -464,15 +464,6 @@ public static BuildTargetResult CheckPrereqCmakePresent(BuildTargetContext c) | ||
[Target] | ||
public static BuildTargetResult SetTelemetryProfile(BuildTargetContext c) | ||
{ | ||
- var gitResult = Cmd("git", "rev-parse", "HEAD") | ||
- .CaptureStdOut() | ||
- .Execute(); | ||
- gitResult.EnsureSuccessful(); | ||
- | ||
- var commitHash = gitResult.StdOut.Trim(); | ||
- | ||
- Environment.SetEnvironmentVariable("DOTNET_CLI_TELEMETRY_PROFILE", $"https://github.com/dotnet/cli;{commitHash}"); | ||
- | ||
return c.Success(); | ||
} | ||
|
||
diff --git a/build_projects/shared-build-targets-utils/Utils/GitUtils.cs b/build_projects/shared-build-targets-utils/Utils/GitUtils.cs | ||
index bae5c67..522958f 100644 | ||
--- a/build_projects/shared-build-targets-utils/Utils/GitUtils.cs | ||
+++ b/build_projects/shared-build-targets-utils/Utils/GitUtils.cs | ||
@@ -6,12 +6,12 @@ public static class GitUtils | ||
{ | ||
public static int GetCommitCount() | ||
{ | ||
- return int.Parse(ExecuteGitCommand("rev-list", "--count", "HEAD")); | ||
+ return 3121; | ||
} | ||
|
||
public static string GetCommitHash() | ||
{ | ||
- return ExecuteGitCommand("rev-parse", "HEAD"); | ||
+ return "1e9d529bc54ed49f33102199e109526ea9c6b3c4"; | ||
} | ||
|
||
private static string ExecuteGitCommand(params string[] args) | ||
-- |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still better to use a GitHub checkout here and it'll remove the need for the patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping for this change