Skip to content

Commit

Permalink
release 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tangxiaolv committed Dec 28, 2016
1 parent 87e8629 commit e9568a7
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 72 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ hs_err_pid*
/build/tmp/jar/MANIFEST.MF
/*.iml
/gradle.properties
/local.properties
/build
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
# HFunc
[ ![Download](https://api.bintray.com/packages/tangxiaolv/maven/hfunc/images/download.svg) ](https://bintray.com/tangxiaolv/maven/hfunc/_latestVersion)

English | [中文](https://github.com/TangXiaoLv/HFunc/blob/master/README_CN.md)

A fast and simple Java Higher-order function lib. Support serial compute and parallel compute.
Applies to Java and Android.

Support
---
+ map
+ filter
+ reduce

Gradle
---
dependencies {
compile 'com.library.tangxiaolv:hfunc:1.0.1'
}

Guide
---
Example:
Expand Down
9 changes: 9 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# HFunc
[ ![Download](https://api.bintray.com/packages/tangxiaolv/maven/hfunc/images/download.svg) ](https://bintray.com/tangxiaolv/maven/hfunc/_latestVersion)

中文 | [English](https://github.com/TangXiaoLv/HFunc/blob/master/README.md)

一个快速简单轻量级高阶函数库,支持串行,并行计算。适用于Java,Android。
Expand All @@ -8,6 +10,13 @@ Support
+ filter
+ reduce

Gradle
---
dependencies {
compile 'com.library.tangxiaolv:hfunc:1.0.1'
}


Guide
---
示例数据集:
Expand Down
93 changes: 30 additions & 63 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,86 +18,53 @@ buildscript {
repositories {
jcenter()
}

dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
}
}

plugins {
id "com.jfrog.bintray" version "1.7.3"
task clean(type: Delete) {
delete rootProject.buildDir
}

group = project.property('GROUP_ID')
version = project.property('PUBLIC_VERSION')
apply plugin: 'com.jfrog.bintray'

allprojects {
repositories {
jcenter()
}
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'java'
}

dependencies {
testCompile 'junit:junit:4.12'
}
group = project.property('GROUP_ID')
version = project.property('PUBLIC_VERSION')

javadoc {
exclude "**/test/**"
}
ext {
bintrayRepo = 'maven'
bintrayName = project.property('LIBRARY_NAME')

publishing {
publications {
MyPublication(MavenPublication) {
from components.java
groupId group
artifactId project.property('ARTIFACT_ID')
version
}
}
}
publishedGroupId = group
libraryName = project.property('LIBRARY_NAME')
artifact = project.property('ARTIFACT_ID')//必须跟Model名一样

bintray {
user = project.property('bintrayUser')
key = project.property('bintrayApiKey')
publications = ['MyPublication']
pkg {
repo = 'maven'
name = project.property('LIBRARY_NAME')
//userOrg = 'myorg' //An optional organization name when the repo belongs to one of the user's orgs
desc = 'what a fantastic package indeed!'
websiteUrl = 'https://github.com/TangXiaoLv/HFunc'
issueTrackerUrl = 'https://github.com/TangXiaoLv/HFunc/issues'
vcsUrl = 'https://github.com/TangXiaoLv/HFunc.git'
licenses = ['Apache-2.0']
labels = ['java', 'Higher-order function', 'map', 'filter', 'parallel']
publicDownloadNumbers = true
/*attributes= ['a': ['ay1', 'ay2'], 'b': ['bee'], c: 'cee'] //Optional package-level attributes
libraryDescription = 'java implement Higher-order function, support map, filter with parallel, android'

githubRepo = 'bintray/gradle-bintray-plugin' //Optional Github repository
githubReleaseNotesFile = 'README.md' //Optional Github readme file*/
siteUrl = 'https://github.com/TangXiaoLv/HFunc'
gitUrl = 'https://github.com/TangXiaoLv/HFunc.git'

//Optional version descriptor
/*version {
name = '1.3-Final' //Bintray logical version name
desc = //Optional - Version-specific description'
released = //Optional - Date of the version release. 2 possible values: date in the format of 'yyyy-MM-dd'T'HH:mm:ss.SSSZZ' OR a java.util.Date instance
vcsTag = '1.3.0'
attributes = ['gradle-plugin': 'com.use.less:com.use.less.gradle:gradle-useless-plugin'] //Optional version-level attributes
//Optional configuration for GPG signing
gpg {
sign = true //Determines whether to GPG sign the files. The default is false
passphrase = 'passphrase' //Optional. The passphrase for GPG signing'
}
//Optional configuration for Maven Central sync of the version
mavenCentralSync {
sync = true //[Default: true] Determines whether to sync the version to Maven Central.
user = 'userToken' //OSS user token: mandatory
password = 'paasword' //OSS user password: mandatory
close = '1' //Optional property. By default the staging repository is closed and artifacts are released to Maven Central. You can optionally turn this behaviour off (by puting 0 as value) and release the version manually.
}
}*/
}
libraryVersion = version

developerId = 'tangxiaolv'
developerName = 'Tang XiaoLv'
developerEmail = 'imbatang@gmail.com'

licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}

task wrapper(type: Wrapper) {
gradleVersion = '2.4.4'
}
// Place it at the end of the file
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rootProject.name = 'HFunc'
rootProject.name = 'hfunc'

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* 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.
*/
package hf;
package com.library.tangxiaolv.hf;

import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -68,7 +68,7 @@ public class HFunc {
* @param func a function to apply to each item
* @param <E> collection item type
* @param <R> the result type
* @return List<R> the result transformed by the specified function
* @return the result transformed by the specified function
*/
public static <E, R> List<R> map(Collection<E> c, Func1<E, R> func) {
if (c == null || c.size() == 0 || func == null) {
Expand All @@ -90,7 +90,7 @@ public static <E, R> List<R> map(Collection<E> c, Func1<E, R> func) {
* @param func a function to apply to each item
* @param <E> collection item type
* @param <R> the result type
* @return List<R> the result transformed by the specified function
* @return the result transformed by the specified function
*/
public static <E, R> List<R> mapParallel(Collection<E> c, final Func1<E, R> func) {
return mapParallel(null, c, func);
Expand All @@ -105,7 +105,7 @@ public static <E, R> List<R> mapParallel(Collection<E> c, final Func1<E, R> func
* @param func a function to apply to each item
* @param <E> collection item type
* @param <R> the result type
* @return List<R> the result transformed by the specified function
* @return the result transformed by the specified function
*/
public static <E, R> List<R> mapParallel(ExecutorService executor, Collection<E> c, final Func1<E, R> func) {
if (c == null || c.size() == 0 || func == null) {
Expand Down Expand Up @@ -152,7 +152,7 @@ public void run() {
* @param c collection with date item
* @param func a function to apply to each item
* @param <E> collection item type
* @return List<E> the result transformed by the specified function
* @return the result transformed by the specified function
*/
public static <E> List<E> filter(Collection<E> c, Func1<E, Boolean> func) {
if (c == null || c.size() == 0 || func == null) {
Expand All @@ -174,7 +174,7 @@ public static <E> List<E> filter(Collection<E> c, Func1<E, Boolean> func) {
* @param c collection with date item
* @param func a function to apply to each item
* @param <E> collection item type
* @return List<E> the result transformed by the specified function
* @return the result transformed by the specified function
*/
public static <E> List<E> filterParallel(Collection<E> c, Func1<E, Boolean> func) {
return filterParallel(null, c, func);
Expand All @@ -188,7 +188,7 @@ public static <E> List<E> filterParallel(Collection<E> c, Func1<E, Boolean> func
* @param c collection with date item
* @param func a function to apply to each item
* @param <E> collection item type
* @return List<E> the result transformed by the specified function
* @return the result transformed by the specified function
*/
public static <E> List<E> filterParallel(ExecutorService executor, Collection<E> c, final Func1<E, Boolean> func) {
if (c == null || c.size() == 0 || func == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package hf;
package com.library.tangxiaolv.hf;

import org.junit.Test;

Expand Down

0 comments on commit e9568a7

Please sign in to comment.