jnr-constants

A set of platform constants (e.g. errno values)

License

License

Categories

Categories

Ruby Languages Ant Build Tools JNR Development Tools Native
GroupId

GroupId

org.jruby.extras
ArtifactId

ArtifactId

jnr-constants
Last Version

Last Version

0.8.1
Release Date

Release Date

Type

Type

jar
Description

Description

jnr-constants
A set of platform constants (e.g. errno values)
Project URL

Project URL

http://github.com/jnr/jnr-constants
Source Code Management

Source Code Management

https://github.com/jnr/jnr-constants

Download jnr-constants

How to add to project

<!-- https://jarcasting.com/artifacts/org.jruby.extras/jnr-constants/ -->
<dependency>
    <groupId>org.jruby.extras</groupId>
    <artifactId>jnr-constants</artifactId>
    <version>0.8.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.jruby.extras/jnr-constants/
implementation 'org.jruby.extras:jnr-constants:0.8.1'
// https://jarcasting.com/artifacts/org.jruby.extras/jnr-constants/
implementation ("org.jruby.extras:jnr-constants:0.8.1")
'org.jruby.extras:jnr-constants:jar:0.8.1'
<dependency org="org.jruby.extras" name="jnr-constants" rev="0.8.1">
  <artifact name="jnr-constants" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.jruby.extras', module='jnr-constants', version='0.8.1')
)
libraryDependencies += "org.jruby.extras" % "jnr-constants" % "0.8.1"
[org.jruby.extras/jnr-constants "0.8.1"]

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 4.5

Project Modules

There are no modules declared in this project.

Java Native Runtime Constants

Build Status

Overview

This project contains Java enums for common POSIX constants. It is predominately used to make calls into jnr-posix far simpler.

Adding Constants

If you want to add new constants to the project, note that all the Java source code is generated. The gen/ directory contains Ruby code to declare the constants you want. The constant values themselves are exctracted by inspection. In order to do so, the code generator will compile a small program that outputs the values of the constants as discovered in declared header files. When the program is run, the output is parsed, and these are the values that are used when generating the Java source.

To run the code generator, you must have Rake installed in Ruby 1.9+. There are three tasks you must run in order to generate all the necessary files.

If you have not added any new constants or modified any constant sets, you can generate updated values for the existing constants on your platform using the generate:platform task. This must be run on each platform you'd like to generate the files for.

$ rake generate:platform

If you have added any constants or sets of constants, you must also run the xplatform and fake generators.

The generate:xplatform variant generates the top-level enum file. While this contains the necessary fields, it does not contain the integer values for those fields. The values lookup is delegated to either an OS-specific (and possibly architecture-specific) implementation or a so-called "fake" implementation, generated by the generate:fake task.

$ rake generate:xplatform
$ rake generate:fake

The generated files are version-controlled. Please remember to commit them in addition to the Ruby templates for the generator.

Building

The project is maven-based. It uses standard maven lifecycle events. To build the code:

$ mvn package

To install the code into your local maven repository:

$ mvn install

To push snapshots out to Sonatype (you must have the necessary permissions):

$ mvn deploy
org.jruby.extras

The Java Native Runtime Project

Versions

Version
0.8.1
0.8