58 Commits

Author SHA1 Message Date
Mike McQuaid
f364f0c841
Merge remote-tracking branch 'origin/master' into deprecate-cask-commands 2020-11-25 09:39:00 +00:00
Mike McQuaid
d496f5c121
Deprecations for Homebrew 2.6.0
Do the usual deprecate/disable dance for the Homebrew 2.6.0 release.

Not to be merged until the next release will definitely be 2.6.0.
2020-11-24 16:44:02 +00:00
Markus Reiter
3c2ec1c60f Deprecate remaining cask commands. 2020-11-21 19:56:12 +01:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
EricFromCanada
212367c1c0 requirements: reword error messages for consistency
also add formatting to download URLs
2020-11-01 15:20:02 -05:00
EricFromCanada
635233b37e requirements: reword inspect() to place tags at end
This more closely matches requirements' display in the DSL.
2020-11-01 15:20:02 -05:00
EricFromCanada
a232ac8b1e requirements: improve display in brew info 2020-11-01 15:20:02 -05:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
0d96616daa Document JavaRequirement. 2020-08-26 03:13:59 +02:00
Mike McQuaid
fa760a2f26
Fix brew style. 2020-07-07 13:12:37 +01:00
Mike McQuaid
4f75a77b08
Update deprecations
Add more deprecations, disable deprecations and remove disabled code.
2020-05-18 13:50:46 +01:00
Mike McQuaid
1e265247ca
rubocop: apply autofixes. 2020-03-13 21:16:18 +00:00
EricFromCanada
5277f849d9 API: supply additional data for requirements 2020-03-03 15:00:33 -05:00
Issy Long
1f6168fe8a
Change regexp.match?(string) to string.match?(regexp) everywhere
- Only try to call `.match?` on strings that aren't nil.
2019-10-13 23:22:51 +01:00
Issy Long
b78028b9c2
Auto-fix Performance/RegexpMatch offenses 2019-10-13 16:04:26 +01:00
Mike McQuaid
2b83463091
Merge pull request #6281 from sjackman/adoptopenjdk
JavaRequirement: Change openjdk to adoptopenjdk
2019-07-08 09:09:56 +01:00
Shaun Jackman
bbbdb08b92 JavaRequirement: Change openjdk to adoptopenjdk 2019-07-07 10:08:56 -07:00
Cheng XU
2bd9b2774d
java_requirement: set cask attribute
Set `@cask` attribute for JavaRequirement, which is used by
`brew info` to track cask requirement for formulae and
`brew bundle dump` to sort the formulae and casks.

Before:
```
$ brew info --json languagetool | jq '.[0].requirements'
[
  {
    "name": "java",
    "cask": null,
    "download": null
  }
]
$ brew cask install adoptopenjdk; brew install languagetool
$ brew bundle dump
brew "languagetool"
cask "adoptopenjdk"
```

After:
```
$ brew info --json languagetool | jq '.[0].requirements'
[
  {
    "name": "java",
    "cask": "adoptopenjdk",
    "download": null
  }
]
$ brew cask install adoptopenjdk; brew install languagetool
$ brew bundle dump
cask "adoptopenjdk"
brew "languagetool"
```

Also added relevant test cases.
2019-06-10 10:37:09 +08:00
Mike McQuaid
c4f72312ce
Fixup brew style failures. 2019-04-30 09:19:18 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Claudia
f155ede7fb
Endorse AdoptOpenJDK instead of Oracle OpenJDK
This commit changes the message that appears when Homebrew detects
that a Java requirement is unmet.

The new message will say:

```
Install AdoptOpenJDK with Homebrew Cask:
  brew cask install adoptopenjdk
```

And for Java 8:

```
Install AdoptOpenJDK 8 with Homebrew Cask:
  brew cask install homebrew/cask-versions/adoptopenjdk8
```
2019-04-19 18:00:31 +02:00
Gary Bartlett
8a6a46da36 Add additional support for java minor versions > 9. 2019-02-06 14:48:19 -08:00
Gary Bartlett
ff5dddab99 Add support for java version strings without periods, e.g. "12-ea" (java-beta). 2019-02-06 06:31:57 -08:00
Bryce Glover
33c3faa125 [JavaRequirement#satisfies_version] java_version_s: Fix regular expression.
The match obtained by applying the regular expression used to index into
the `stderr` member of the result of calling `system_command` in the relevant
variable assignment could yield unexpected results.  The regular expression in-
volved was not strict enough and contained an unescaped period, which could
match any character, not just the expected literal decimal point.  This commit
corrects this oversight by escaping the relevant character, thus addressing
@apjanke's remark in https://github.com/Homebrew/brew/pull/5280#issuecomment-437165119 on the existence of a:

> …possible bug - that `.` looks like it should be escaped as `\.` to match a
> literal ".".) …
2018-12-14 13:45:55 -05:00
Shaun Jackman
e8b22690a0 Fix Language::Java::java_home_env for Linux
/usr/libexec/java_home is specific to macOS.
Language::Java::java_home_cmd is not implemented on Linux and raises
NotImplementedError.

Add private Language::Java::java_home_shell and use it instead of java_home_cmd.
Add public Language::Java::java_home for use by formulae.
2018-11-29 12:50:31 -08:00
Mike McQuaid
1365010f93
Merge pull request #5280 from apjanke/fix-java-req-version-parsing
JavaRequirement: fix version parsing to handle Java 9 and higher
2018-11-19 14:03:10 +00:00
Shaun Jackman
d2dba5fc4a DependencyCollector: Add java_dep_if_needed [Linux]
Use the openjdk formula if it's installed.
Use the host's Java if it's sufficient.
Otherwise install the openjdk formula.
2018-11-11 10:18:24 -08:00
Andrew Janke
e1e40a4b1a JavaRequirement: fix version parsing to handle Java 9 and higher 2018-11-08 22:48:17 -05:00
Mike McQuaid
737b84b54b
brew style --fix fixes. 2018-11-02 17:29:23 +00:00
Mike McQuaid
0c0275771d
Cleanup Requirements
- remove unused NonBinaryOsxfuseRequirement
- import CodeSignRequirement from Homebrew/homebrew-core
- remove unused UnsignedKextRequirement
- don’t allow custom name for X11Requirement
2018-10-19 16:38:41 +01:00
commitay
1243183294
Merge pull request #4876 from commitay/jdk11
java_requirement, cask dsl caveats: JDK 11
2018-09-26 08:35:03 +10:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
commitay
93cffa77bf requirements/java_requirement: JDK 11 2018-09-12 08:30:36 +10:00
Markus Reiter
32ad22395b Remove some #popen_reads. 2018-09-04 05:16:59 +02:00
Mike McQuaid
80d75bc0d8
Homebrew/.rubocop: tweak rules.
Adjust the rules based on the current codebase. Remove various enable,
disables and default values that are unnecessary. Add more comments
explaining why. Make minor changes needed to enable a few more rules.
2018-09-02 20:15:09 +01:00
Markus Reiter
de246cc528 Update Homebrew-Cask references. 2018-05-25 18:20:02 +02:00
Markus Reiter
c4222141ac Revert "Update Homebrew-Cask references."
This reverts commit 4475651b548afdcf15c4cf7a7cb57baca1885186.
2018-05-25 17:57:32 +02:00
Markus Reiter
4475651b54 Update Homebrew-Cask references. 2018-05-25 17:56:16 +02:00
Mike McQuaid
a4bada575a requirements: define cask on base class.
The `cask` attribute doesn't make as much sense on Linux but can be
ignored there. The advantage of this change is that (like #4086) it
allows figuring out the relevant cask for a formulae requirement on a
Linux machine.
2018-04-18 09:55:44 +01:00
Mike McQuaid
d54e670a64 requirements: move more to compat. 2017-12-30 20:56:55 +00:00
Mike McQuaid
8410950d14 java_requirement: use popen_read :err option. 2017-12-14 16:44:25 +00:00
Dominyk Tiller
19790679bc
java_requirement: fix detection of new Java versioning scheme
Closes https://github.com/Homebrew/brew/issues/3331.
2017-10-18 07:13:33 +01:00
Mike McQuaid
01e9ec9a9f Rubocop: automatic rule fixes. 2017-09-24 21:23:59 +01:00
Markus Reiter
2d6ae61314 Re-revert "Fix operator spacing." 2017-06-02 19:22:05 +02:00
ilovezfs
197392b56d Revert "Fix operator spacing." 2017-06-01 04:06:40 -07:00
Markus Reiter
d34ba7395b Fix operator spacing. 2017-05-31 19:53:41 +02:00
Bob W. Hogg
c3b309e795 java_requirement: Add newline to failure message
Signed-off-by: Bob W. Hogg <rwhogg@linux.com>
2017-04-02 14:38:43 -07:00
Viktor Szakats
c5a9ee5719 java_requirement.rb: use HTTPS in Java Platform URL
It's redirected to cleartext, though this URL will be opened
in a browser so it won't be something hidden, and maybe
Oracle will fix this in the future.
2017-03-11 11:35:19 +01:00
Bob W. Hogg
c49b97dd9c Code review cleanups 2017-02-15 21:47:08 -08:00
Bob W. Hogg
5a214de68d java_requirement: port to Linux and refactor
Split the core requirement class into generic, Linux-specific,
and macOS-specific parts.

Additionally, the Linux version is now able to detect Java versions
(the previous Linuxbrew implementation was only able to detect
if Java was present at all.)
2017-02-15 21:35:26 -08:00