Skip to content

Commit

Permalink
add bintray
Browse files Browse the repository at this point in the history
  • Loading branch information
g0ddest committed Dec 28, 2020
1 parent aca7cec commit e02cd97
Show file tree
Hide file tree
Showing 2 changed files with 133 additions and 3 deletions.
42 changes: 40 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Fixed Length handler for Java

![Gradle Build](https://github.com/g0ddest/fixedlength/workflows/Gradle%20Build/badge.svg?branch=master)

[![bintray](https://api.bintray.com/packages/velikodniy/fixedlength/fixedlength/images/download.svg) ](https://bintray.com/velikodniy/fixedlength/fixedlength/_latestVersion)

This is fast simple zero-dependency library for Java 8+ that aims to parse fixed length files.

Library was inspired by [Fixed Length File Handler](https://github.com/GuiaBolso/fixed-length-file-handler) and [fixedformat4j](https://github.com/jeyben/fixedformat4j).
Expand All @@ -10,6 +11,43 @@ One of its advantages is support mixed line types.

It works with `InputStream` so it is more memory efficient than store all file in memory. This is big advantage when working with big files.

## Download

This library is published to Bintray jcenter, so you'll need to configure that in your repositories:

```groovy
repositories {
mavenCentral()
jcenter()
}
```

And then configure dependency:

Maven:
```xml
<dependency>
<groupId>name.velikodniy.vitaliy</groupId>
<artifactId>fixedlength</artifactId>
<version>0.1</version>
<type>pom</type>
</dependency>
```

Gradle:
```groovy
implementation 'name.velikodniy.vitaliy:fixedlength:0.1'
```

Ivy:
```xml
<dependency org='name.velikodniy.vitaliy' name='fixedlength' rev='0.1'>
<artifact name='fixedlength' ext='pom' ></artifact>
</dependency>
```

## Usage

For example, you can transform this lines to 2 different kind of objects:

```
Expand Down Expand Up @@ -120,4 +158,4 @@ There are all fields in `FixedField` annotation:
* `align` — on which side the content is justified. It works with padding.
* `padding` — based on align trimming filler symbols. For example `" 1"` becomes `"1"`.
* `format` — parameters that goes to formatter. For example, it can be date format.
* `divide` — for number fields you can automatically divide the value on 10^n where n is value of this parameter.
* `divide` — for number fields you can automatically divide the value on 10^n where n is value of this parameter.
94 changes: 93 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,106 @@
buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
}

plugins {
id "com.jfrog.bintray" version "1.8.5"
id "maven-publish"
id 'java'
}

group 'name.velikodniy.vitaliy.fixedlength'
group 'name.velikodniy.vitaliy'
version '0.1'

repositories {
mavenLocal()
mavenCentral()
jcenter()
}

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
}

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}

javadoc.failOnError = false
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives sourcesJar
archives javadocJar
}

def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
developers {
developer {
id "velikodniy"
name "Vitaliy Velikodniy"
email "vitaliy@velikodniy.name"
}
}

scm {
url "https://github.com/g0ddest/fixedlength"
}
}

publishing {
publications {
mavenPublication(MavenPublication) {
from components.java
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
groupId 'name.velikodniy.vitaliy'
artifactId 'fixedlength'
version '0.1'
pom.withXml {
def root = asNode()
root.appendNode('description', 'Fast simple zero-dependency Java library to parse fixed length files')
root.appendNode('name', 'fixedlength')
root.appendNode('url', 'https://github.com/g0ddest/fixedlength')
root.children().last() + pomConfig
}
}
}
}

bintray {
user = System.getProperty('bintray.user') != null ? System.getProperty('bintray.user') : System.getenv('bintray.user')
key = System.getProperty('bintray.key') != null ? System.getProperty('bintray.key') : System.getenv('bintray.key')
publications = ['mavenPublication']

pkg {
repo = 'fixedlength'
name = 'fixedlength'
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/g0ddest/fixedlength'
version {
name = '0.1'
desc = '0.1'
released = new Date()
}
}

}

0 comments on commit e02cd97

Please sign in to comment.