From e02cd97dfdae4769df196546c1077fe10eaa74a3 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Mon, 28 Dec 2020 14:04:23 +0200 Subject: [PATCH] add bintray --- README.md | 42 +++++++++++++++++++++-- build.gradle | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 133 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 80b6780..fc66a01 100644 --- a/README.md +++ b/README.md @@ -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). @@ -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 + + name.velikodniy.vitaliy + fixedlength + 0.1 + pom + +``` + +Gradle: +```groovy +implementation 'name.velikodniy.vitaliy:fixedlength:0.1' +``` + +Ivy: +```xml + + + +``` + +## Usage + For example, you can transform this lines to 2 different kind of objects: ``` @@ -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. \ No newline at end of file diff --git a/build.gradle b/build.gradle index 19868c3..a49606f 100644 --- a/build.gradle +++ b/build.gradle @@ -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() + } + } + } \ No newline at end of file