-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
111 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
sources: | ||
"4.13.1": | ||
jar: | ||
url: "https://www.antlr.org/download/antlr-4.13.1-complete.jar" | ||
sha256: "bc13a9c57a8dd7d5196888211e5ede657cb64a3ce968608697e4f668251a8487" | ||
license: | ||
url: "https://raw.githubusercontent.com/antlr/antlr4/4.13.1/LICENSE.txt" | ||
sha256: "3db1fb3ee79a4b4f9918fc4d0f6133bf18a3cf787f126cd22f8aa9b862281c0c" |
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 @@ | ||
from conan import ConanFile | ||
from conan.tools.files import copy, download, save | ||
import os | ||
import stat | ||
|
||
|
||
required_conan_version = ">=1.47.0" | ||
|
||
|
||
class Antlr4Conan(ConanFile): | ||
name = "antlr4" | ||
description = "powerful parser generator for reading, processing, executing, or translating structured text or binary files." | ||
license = "BSD-3-Clause" | ||
url = "https://github.com/conan-io/conan-center-index" | ||
homepage = "https://github.com/antlr/antlr4" | ||
topics = ("parser", "generator") | ||
package_type = "application" | ||
settings = "os", "arch", "compiler", "build_type" | ||
|
||
def layout(self): | ||
pass | ||
|
||
def requirements(self): | ||
self.requires("openjdk/21.0.1") | ||
|
||
def package_id(self): | ||
del self.info.settings.arch | ||
del self.info.settings.compiler | ||
del self.info.settings.build_type | ||
|
||
def source(self): | ||
v = self.conan_data["sources"][self.version] | ||
download( | ||
self, | ||
url=v["jar"]["url"], | ||
filename=os.path.join(self.source_folder, "antlr-complete.jar"), | ||
sha256=v["jar"]["sha256"], | ||
) | ||
download( | ||
self, | ||
url=v["license"]["url"], | ||
filename=os.path.join(self.source_folder, "LICENSE.txt"), | ||
sha256=v["license"]["sha256"], | ||
) | ||
|
||
def package(self): | ||
copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) | ||
copy(self, pattern="antlr-complete.jar", dst=os.path.join(self.package_folder, "res"), src=self.source_folder) | ||
if self.settings.os == "Windows": | ||
save(self, | ||
path=os.path.join(self.package_folder, "bin", "antlr4.bat"), | ||
content="""\ | ||
java -classpath %CLASSPATH% org.antlr.v4.Tool %* | ||
""" | ||
) | ||
else: | ||
bin_path = os.path.join(self.package_folder, "bin", "antlr4") | ||
save(self, | ||
path=bin_path, | ||
content="""\ | ||
#!/bin/bash | ||
java -classpath $CLASSPATH org.antlr.v4.Tool $@ | ||
""" | ||
) | ||
st = os.stat(bin_path) | ||
os.chmod(bin_path, st.st_mode | stat.S_IEXEC) | ||
|
||
def package_info(self): | ||
self.cpp_info.frameworkdirs = [] | ||
self.cpp_info.libdirs = [] | ||
self.cpp_info.resdirs = [] | ||
self.cpp_info.includedirs = [] | ||
|
||
jar = os.path.join(self.package_folder, "res", "antlr-complete.jar") | ||
self.runenv_info.prepend_path("CLASSPATH", jar) |
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,15 @@ | ||
from conan import ConanFile | ||
from conan.tools.build import can_run | ||
|
||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "arch", "compiler", "build_type" | ||
generators = "VirtualBuildEnv" | ||
test_type = "explicit" | ||
|
||
def build_requirements(self): | ||
self.tool_requires(self.tested_reference_str) | ||
|
||
def test(self): | ||
if can_run(self): | ||
self.run("antlr4") |
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,3 @@ | ||
versions: | ||
"4.13.1": | ||
folder: all |
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 |
---|---|---|
@@ -1,19 +1,13 @@ | ||
sources: | ||
"7.4.0": | ||
url: "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.4.0/openapi-generator-cli-7.4.0.jar" | ||
sha256: "e42769a98fef5634bee0f921e4b90786a6b3292aa11fe8d2f84c045ac435ab29" | ||
"7.3.0": | ||
url: "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.3.0/openapi-generator-cli-7.3.0.jar" | ||
sha256: "879c15340a75a19a7e720efc242c3223e0e4207b0694d6d1cea5c7dd87cf1cce" | ||
"7.2.0": | ||
url: "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.2.0/openapi-generator-cli-7.2.0.jar" | ||
sha256: "1cf0c80de12c0fdc8594289c19e414b402108ef10b8dd0bfda1953151341ab5d" | ||
"7.0.0": | ||
url: "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.0.0/openapi-generator-cli-7.0.0.jar" | ||
sha256: "80e8e9d71bdbdf513b8c65cf7d3fc2fe3d88aaeb4e39a2c6e20831f00032c775" | ||
"6.6.0": | ||
url: "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.6.0/openapi-generator-cli-6.6.0.jar" | ||
sha256: "9718ff7844e89462c75dcd9b20a35136f6db257bfe1b874db1e3002e99de4609" | ||
"6.5.0": | ||
url: "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.5.0/openapi-generator-cli-6.5.0.jar" | ||
sha256: "f18d771e98f2c5bb169d1d1961de4f94866d2901abc1e16177dd7e9299834721" | ||
"6.4.0": | ||
url: "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.4.0/openapi-generator-cli-6.4.0.jar" | ||
sha256: "35aead300e0c9469fbd9d30cf46f4153897dcb282912091ca4ec9212dce9d151" |
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 |
---|---|---|
@@ -1,13 +1,9 @@ | ||
versions: | ||
"7.4.0": | ||
folder: all | ||
"7.3.0": | ||
folder: all | ||
"7.2.0": | ||
folder: all | ||
"7.0.0": | ||
folder: all | ||
"6.6.0": | ||
folder: all | ||
"6.5.0": | ||
folder: all | ||
"6.4.0": | ||
folder: all |
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
versions: | ||
"3.45.2": | ||
folder: all | ||
"3.45.1": | ||
folder: all | ||
"3.45.0": | ||
|