1 Star 0 Fork 0

merore/jnr-constants

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

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
Licensed 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. Alternatively, you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License version 3 for more details. You should have received a copy of the GNU Lesser General Public License version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.

简介

暂无描述 展开 收起
Java 等 2 种语言
Apache-2.0
取消

发行版

暂无发行版

贡献者 (1)

全部

近期动态

Pushed a new jnr-constants-0.9.9 branch over 3 years ago
Pushed a new jnr-constants-0.9.0 branch over 3 years ago
Deleted a jnr-constants-0.9.0 branch over 3 years ago
Pushed a new jnr-constants-0.9.0 branch over 3 years ago
Pushed a new jnr-constants-0.10.1 branch over 3 years ago
加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/merore/jnr-constants.git
git@gitee.com:merore/jnr-constants.git
merore
jnr-constants
jnr-constants
jnr-constants-0.9.15

搜索帮助