Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 58 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,59 @@
build/
target/
!.mvn/wrapper/maven-wrapper.jar
.DS_Store
out/
generated/
generated_tests/
generated-resources-dir/
bin/
*.swp

# python
__pycache__
venv
.pyc

# Compiled class file
*.class

# Log file
*.log
*.log*

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.gradle/*

### IntelliJ IDEA ###
.idea
.gradle
build
profilers
testdata
hotspot_*.log
*.iws
*.iml
*.ipr
#### Intellij run configuration
.run/

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*
*/.gradle/*
82 changes: 60 additions & 22 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import me.champeau.jmh.JmhBytecodeGeneratorTask
import org.ajoberstar.grgit.Grgit
import org.gradle.internal.os.OperatingSystem

import java.time.Duration
Expand All @@ -8,17 +7,17 @@ plugins {
id 'java'
id 'scala'
id 'me.champeau.jmh' version '0.7.1'
id 'org.ajoberstar.grgit' version '5.2.0'
id 'pl.allegro.tech.build.axion-release' version '1.15.5'
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0'
id 'pl.allegro.tech.build.axion-release' version '1.21.1'
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
id 'maven-publish'
id 'signing'
}

scmVersion {
versionCreator('versionWithBranch')
tag {
prefix = ''
// Property<String> in newer versions
prefix.set('')
}
}

Expand Down Expand Up @@ -62,20 +61,43 @@ dependencies {
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: junitVersion
}

tasks.register('downloadTestData') {
doFirst {
def testDataDir = new File("${project.projectDir.getAbsolutePath()}/testdata")
if (!testDataDir.exists()) {
testDataDir.mkdir()
}
def numbersTestDataDir = new File("${testDataDir}/parse-number-fxx-test-data")
if (!numbersTestDataDir.exists()) {
def grgit = Grgit.clone(dir: numbersTestDataDir, uri: 'https://github.com/nigeltao/parse-number-fxx-test-data.git')
grgit.close()
def testdataParent = layout.projectDirectory.dir("testdata")
def repoDir = testdataParent.dir("parse-number-fxx-test-data")

tasks.register('prepareTestDataDir') {
description = 'Create testdata/ directory if missing'
doLast {
def parent = testdataParent.asFile
if (!parent.exists()) {
logger.lifecycle("Creating ${parent}")
parent.mkdirs()
}
}
}

tasks.register('downloadTestData', Exec) {
description = 'Clone parse-number-fxx-test-data into testdata/ if missing'
group = 'verification'
dependsOn tasks.named('prepareTestDataDir')

// Run if repo dir missing OR empty (handles half-created directories)
onlyIf {
def d = repoDir.asFile
!d.exists() || (d.isDirectory() && (d.listFiles() == null || d.listFiles().length == 0))
}

workingDir testdataParent.asFile
commandLine 'git', 'clone', 'https://github.com/nigeltao/parse-number-fxx-test-data.git', 'parse-number-fxx-test-data'

doFirst {
logger.lifecycle("Cloning parse-number-fxx-test-data into ${repoDir.asFile}")
}
}

tasks.withType(Test).configureEach {
dependsOn tasks.named('downloadTestData')
}

tasks.register('test256', Test) {
dependsOn downloadTestData
useJUnitPlatform()
Expand Down Expand Up @@ -103,8 +125,18 @@ tasks.register('test512', Test) {
}

test {
// run JUnit 5 tests
useJUnitPlatform()

jvmArgs += [
'--add-modules', 'jdk.incubator.vector', '-Xmx2g'
]
// still run the vector-width-specific tasks first
dependsOn 'test256'
dependsOn 'test512'

// and don't blow up if this particular task finds nothing
failOnNoDiscoveredTests = false
}

tasks.withType(JmhBytecodeGeneratorTask).configureEach {
Expand Down Expand Up @@ -206,15 +238,21 @@ if (System.getenv('GPG_KEY_ID')) {
nexusPublishing {
repositories {
sonatype {
nexusUrl = uri("https://ossrh-staging-api.central.sonatype.com/service/local/")
snapshotRepositoryUrl = uri("https://central.sonatype.com/repository/maven-snapshots/")
stagingProfileId = '3c0bbfe420699e'
username = System.getenv('SONATYPE_USERNAME')
password = System.getenv('SONATYPE_PASSWORD')
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))

if (System.getenv('SONATYPE_USERNAME')) {
username.set(System.getenv('SONATYPE_USERNAME'))
}
if (System.getenv('SONATYPE_PASSWORD')) {
password.set(System.getenv('SONATYPE_PASSWORD'))
}

stagingProfileId.set('3c0bbfe420699e')
}
}
connectTimeout = Duration.ofMinutes(3)
clientTimeout = Duration.ofMinutes(3)
connectTimeout.set(Duration.ofMinutes(3))
clientTimeout.set(Duration.ofMinutes(3))
}

def getBooleanProperty(String name, boolean defaultValue) {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
5 changes: 1 addition & 4 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

#
# Copyright © 2015-2021 the original authors.
# Copyright © 2015 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -114,7 +114,6 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac

CLASSPATH="\\\"\\\""


# Determine the Java command to use to start the JVM.
Expand Down Expand Up @@ -172,7 +171,6 @@ fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )

JAVACMD=$( cygpath --unix "$JAVACMD" )

Expand Down Expand Up @@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"

Expand Down
3 changes: 1 addition & 2 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,10 @@ goto fail
:execute
@rem Setup the command line

set CLASSPATH=


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down