forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add metadata to Windows exe files (elastic#16048)
This adds metadata to the Windows .exe files that the build produces. This makes our binaries a little more friendly to automation on Windows because you can check the version programmatically with ease. It also makes is easy for end user to inspect some details about the file from the file properties dialog in Windows. Closes elastic#15232 For example: ``` PS C:\vagrant\winlogbeat > (Get-Info .\winlogbeat.exe).VersionInfo | Format-List OriginalFilename : winlogbeat.exe FileDescription : Winlogbeat ships Windows event logs to Elasticsearch or Logstash. ProductName : Winlogbeat Comments : commit=8d6cf58f347579188d707421da6b70b2f66701ea CompanyName : Elastic FileName : C:\vagrant\winlogbeat\winlogbeat.exe FileVersion : 8.0.0 ProductVersion : 8.0.0 IsDebug : False IsPatched : False IsPreRelease : False IsPrivateBuild : False IsSpecialBuild : False Language : Language Neutral LegalCopyright : Copyright Elastic, License ASL 2.0 LegalTrademarks : PrivateBuild : SpecialBuild : FileVersionRaw : 8.0.0.0 ProductVersionRaw : 8.0.0.0 ``` (cherry picked from commit 695b167)
- Loading branch information
1 parent
d8cd2ff
commit 288faf3
Showing
24 changed files
with
2,028 additions
and
9 deletions.
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
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
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
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
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,47 @@ | ||
// Licensed to Elasticsearch B.V. under one or more contributor | ||
// license agreements. See the NOTICE file distributed with | ||
// this work for additional information regarding copyright | ||
// ownership. Elasticsearch B.V. licenses this file to you under | ||
// the Apache License, Version 2.0 (the "License"); you may | ||
// not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
package mage | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestParseVersion(t *testing.T) { | ||
var tests = []struct { | ||
Version string | ||
Major, Minor, Patch int | ||
}{ | ||
{"v1.2.3", 1, 2, 3}, | ||
{"1.2.3", 1, 2, 3}, | ||
{"1.2.3-SNAPSHOT", 1, 2, 3}, | ||
{"1.2.3rc1", 1, 2, 3}, | ||
{"1.2", 1, 2, 0}, | ||
} | ||
|
||
for _, tc := range tests { | ||
major, minor, patch, err := ParseVersion(tc.Version) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
assert.Equal(t, tc.Major, major) | ||
assert.Equal(t, tc.Minor, minor) | ||
assert.Equal(t, tc.Patch, patch) | ||
} | ||
} |
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
vendor/github.com/akavel/rsrc/binutil/sizedfile.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.