Commit Graph
43 Commits
Author SHA1 Message Date
Mike McQuaidandGitHub 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 McQuaidandGitHub 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
commitayandGitHub 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 4475651b54.
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
ilovezfsandGitHub 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 SzakatsandGitHub 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
Andrew Janke 5aaccba34c info: include versions and other details in Requirements display 2016-09-24 21:39:33 -04:00
Mike McQuaid 3982950e61 rubocop --auto-correct all hash-rocket usage. 2016-09-17 16:14:13 +01:00
Mike McQuaid fb0e121686 requirements/java_requirement: fix Rubocop warnings. 2016-09-11 17:42:44 +01:00
Xu Cheng 3972b900f3 JavaRequirement: use next instead of return in code block 2016-05-01 14:31:26 +08:00
Misty De MeoandMisty De Meo c20622ade4 JavaRequirement: return false if no java_home
Closes #118.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2016-04-22 22:37:21 -07:00
Xu Cheng d7a479f551 JavaRequirement: check satisfaction directly
It made less sense to call a method `java_version` when it returns
boolean value.

Closes Homebrew/homebrew#45501.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-10-31 20:22:17 +08:00
Jack Nagel 27e184f543 Mark some requirements that don't need the build environment 2015-06-26 00:00:44 -04:00
Mike McQuaid 1e86730289 Rename requirements named *Dependency.
Dependency is another similar, related class and it's super confusing
to have some Requirements that are named *Dependency.

Closes Homebrew/homebrew#38891.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-06-16 08:12:01 +01:00