Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build native packages for Linux, update dependencies #229

Merged
merged 11 commits into from
Jan 9, 2022
Merged
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
31 changes: 26 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ on:

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
java: [17]
os: ['ubuntu-latest']
name: Build on ${{ matrix.os }} with Java ${{ matrix.java }}
runs-on: ${{ matrix.os }}
env:
DEFAULT_JAVA: 17
DEFAULT_OS: 'ubuntu-latest'

steps:

Expand Down Expand Up @@ -51,14 +53,14 @@ jobs:
./gradlew build --warning-mode=summary -PskipFlakyTests=true

- name: Sonar analysis
if: ${{ env.DEFAULT_JAVA == matrix.java && env.SONAR_TOKEN != null }}
if: ${{ env.DEFAULT_JAVA == matrix.java && env.DEFAULT_OS == matrix.os && env.SONAR_TOKEN != null }}
run: |
./gradlew sonarqube -Dsonar.login=$SONAR_TOKEN --warning-mode=summary
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

- name: Publish Test Report for Java ${{ matrix.java }}
- name: Publish Test Report for Java ${{ matrix.java }} on ${{ matrix.os }}
uses: scacap/action-surefire-report@v1
if: ${{ always() && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }}
with:
Expand All @@ -67,7 +69,26 @@ jobs:

- name: Archive jfxui binary
uses: actions/upload-artifact@v2
if: ${{ env.DEFAULT_JAVA == matrix.java }}
if: ${{ env.DEFAULT_JAVA == matrix.java && env.DEFAULT_OS == matrix.os }}
with:
name: jfxui
path: jfxui/build/libs/white-rabbit-fx-*.jar

- name: Build native package for ${{ matrix.os }}
if: ${{ env.DEFAULT_JAVA == matrix.java }}
run: |
./gradlew jpackage createChecksums --warning-mode=summary

- name: Archive native package
uses: actions/upload-artifact@v2
if: ${{ env.DEFAULT_JAVA == matrix.java }}
with:
name: native-package-${{ matrix.java }}
path: jfxui/build/jpackage-dist/*

- name: Archive checksums
uses: actions/upload-artifact@v2
if: ${{ env.DEFAULT_JAVA == matrix.java }}
with:
name: checksums
path: jfxui/build/generatedChecksums/*
38 changes: 37 additions & 1 deletion api/.settings/org.eclipse.jdt.ui.prefs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
eclipse.preferences.version=1
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
formatter_profile=_itsallcode style
formatter_settings_version=20
formatter_settings_version=21
sp_cleanup.add_all=false
sp_cleanup.add_default_serial_version_id=true
sp_cleanup.add_generated_serial_version_id=false
Expand All @@ -16,27 +16,35 @@ sp_cleanup.always_use_blocks=true
sp_cleanup.always_use_parentheses_in_expressions=false
sp_cleanup.always_use_this_for_non_static_field_access=false
sp_cleanup.always_use_this_for_non_static_method_access=false
sp_cleanup.array_with_curly=false
sp_cleanup.arrays_fill=false
sp_cleanup.bitwise_conditional_expression=false
sp_cleanup.boolean_literal=false
sp_cleanup.boolean_value_rather_than_comparison=false
sp_cleanup.break_loop=false
sp_cleanup.collection_cloning=false
sp_cleanup.comparing_on_criteria=false
sp_cleanup.comparison_statement=false
sp_cleanup.controlflow_merge=false
sp_cleanup.convert_functional_interfaces=false
sp_cleanup.convert_to_enhanced_for_loop=false
sp_cleanup.convert_to_enhanced_for_loop_if_loop_var_used=false
sp_cleanup.convert_to_switch_expressions=false
sp_cleanup.correct_indentation=false
sp_cleanup.do_while_rather_than_while=false
sp_cleanup.double_negation=false
sp_cleanup.else_if=false
sp_cleanup.embedded_if=false
sp_cleanup.evaluate_nullable=false
sp_cleanup.extract_increment=false
sp_cleanup.format_source_code=true
sp_cleanup.format_source_code_changes_only=false
sp_cleanup.hash=false
sp_cleanup.if_condition=false
sp_cleanup.insert_inferred_type_arguments=false
sp_cleanup.instanceof=false
sp_cleanup.instanceof_keyword=false
sp_cleanup.invert_equals=false
sp_cleanup.join=false
sp_cleanup.lazy_logical_operator=false
sp_cleanup.make_local_variable_final=true
Expand All @@ -46,24 +54,34 @@ sp_cleanup.make_type_abstract_if_missing_method=false
sp_cleanup.make_variable_declarations_final=true
sp_cleanup.map_cloning=false
sp_cleanup.merge_conditional_blocks=false
sp_cleanup.multi_catch=false
sp_cleanup.never_use_blocks=false
sp_cleanup.never_use_parentheses_in_expressions=true
sp_cleanup.no_string_creation=false
sp_cleanup.no_super=false
sp_cleanup.number_suffix=false
sp_cleanup.objects_equals=false
sp_cleanup.on_save_use_additional_actions=true
sp_cleanup.one_if_rather_than_duplicate_blocks_that_fall_through=false
sp_cleanup.operand_factorization=false
sp_cleanup.organize_imports=true
sp_cleanup.overridden_assignment=false
sp_cleanup.plain_replacement=false
sp_cleanup.precompile_regex=false
sp_cleanup.primitive_comparison=false
sp_cleanup.primitive_parsing=false
sp_cleanup.primitive_rather_than_wrapper=false
sp_cleanup.primitive_serialization=false
sp_cleanup.pull_out_if_from_if_else=false
sp_cleanup.pull_up_assignment=false
sp_cleanup.push_down_negation=false
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
sp_cleanup.reduce_indentation=false
sp_cleanup.redundant_comparator=false
sp_cleanup.redundant_falling_through_block_end=false
sp_cleanup.remove_private_constructors=true
sp_cleanup.remove_redundant_modifiers=false
Expand All @@ -81,21 +99,38 @@ sp_cleanup.remove_unused_private_fields=true
sp_cleanup.remove_unused_private_members=false
sp_cleanup.remove_unused_private_methods=true
sp_cleanup.remove_unused_private_types=true
sp_cleanup.return_expression=false
sp_cleanup.simplify_lambda_expression_and_method_ref=false
sp_cleanup.single_used_field=false
sp_cleanup.sort_members=false
sp_cleanup.sort_members_all=false
sp_cleanup.standard_comparison=false
sp_cleanup.static_inner_class=false
sp_cleanup.strictly_equal_or_different=false
sp_cleanup.stringbuffer_to_stringbuilder=false
sp_cleanup.stringbuilder=false
sp_cleanup.stringbuilder_for_local_vars=false
sp_cleanup.stringconcat_to_textblock=false
sp_cleanup.substring=false
sp_cleanup.switch=false
sp_cleanup.system_property=false
sp_cleanup.system_property_boolean=false
sp_cleanup.system_property_file_encoding=false
sp_cleanup.system_property_file_separator=false
sp_cleanup.system_property_line_separator=false
sp_cleanup.system_property_path_separator=false
sp_cleanup.ternary_operator=false
sp_cleanup.try_with_resource=false
sp_cleanup.unlooped_while=false
sp_cleanup.unreachable_block=false
sp_cleanup.use_anonymous_class_creation=false
sp_cleanup.use_autoboxing=false
sp_cleanup.use_blocks=true
sp_cleanup.use_blocks_only_for_return_and_throw=false
sp_cleanup.use_directly_map_method=false
sp_cleanup.use_lambda=true
sp_cleanup.use_parentheses_in_expressions=false
sp_cleanup.use_string_is_blank=false
sp_cleanup.use_this_for_non_static_field_access=false
sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
sp_cleanup.use_this_for_non_static_method_access=false
Expand All @@ -104,3 +139,4 @@ sp_cleanup.use_unboxing=false
sp_cleanup.use_var=false
sp_cleanup.useless_continue=false
sp_cleanup.useless_return=false
sp_cleanup.valueof_rather_than_instantiation=false
1 change: 0 additions & 1 deletion api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ java {

javadoc {
enabled = true
options.addBooleanOption('html5', true)
}

def getOptionalProperty(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,31 @@

import org.itsallcode.whiterabbit.api.features.PluginFeature;

/**
* Base class for plugins that support a defined {@link PluginFeature}.
*
* @param <S>
* the supported {@link PluginFeature}.
*/
public abstract class AbstractPlugin<S extends PluginFeature> implements Plugin
{
private final String id;
private final Class<S> featureType;

/**
* The plugin configuration. Will be {@code null} until
* {@link #init(PluginConfiguration)} was called.
*/
protected PluginConfiguration config;

/**
* Constructor.
*
* @param id
* the id of the new plugin.
* @param featureType
* the {@link PluginFeature} that the new plugin supports.
*/
protected AbstractPlugin(String id, Class<S> featureType)
{
this.featureType = featureType;
Expand All @@ -23,7 +42,7 @@ public void init(PluginConfiguration config)
}

@Override
public String getId()
public final String getId()
{
return id;
}
Expand All @@ -35,15 +54,21 @@ public void close()
}

@Override
public boolean supports(Class<? extends PluginFeature> featureType)
public final boolean supports(Class<? extends PluginFeature> featureType)
{
return this.featureType.isAssignableFrom(featureType);
}

/**
* Plugins must implement this and return a new instance of the
* {@link PluginFeature} type.
*
* @return a new {@link PluginFeature} instance.
*/
protected abstract S createInstance();

@Override
public <T extends PluginFeature> Optional<T> getFeature(Class<T> featureType)
public final <T extends PluginFeature> Optional<T> getFeature(Class<T> featureType)
{
if (this.supports(featureType))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,10 @@ public interface PluginConfiguration
*/
Optional<String> getOptionalValue(String propertyName);

/**
* Get the {@link Path} to the data directory.
*
* @return the {@link Path} to the data directory.
*/
Path getDataDir();
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,42 @@
import java.time.LocalDate;
import java.util.List;

import org.itsallcode.whiterabbit.api.model.DayType;

/**
* {@link PluginFeature} that generates a {@link List} of
* {@link HolidayInstance} for each day. WhiteRabbit will will marked these days
* as {@link DayType#HOLIDAY} when switching to a new month.
*/
public interface Holidays extends PluginFeature
{
/**
* Get all holidays for a given date.
*
* @param date
* the date for which to get holidays.
* @return a {@link List} of holidays on the given date.
*/
List<HolidayInstance> getHolidays(LocalDate date);

/**
* Represents a holiday instance.
*/
interface HolidayInstance
{
/**
* @return the holiday category, e.g. "public".
*/
String getCategory();

/**
* @return the local name of the holiday.
*/
String getName();

/**
* @return the date of the holiday.
*/
LocalDate getDate();
}

List<HolidayInstance> getHolidays(LocalDate date);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,49 @@
*/
public interface ActivityData
{
/**
* @return the project's ID.
*/
String getProjectId();

/**
* Set the project's ID.
*
* @param id
* the new ID.
*/
void setProjectId(String id);

/**
* @return the duration of the activity.
*/
Duration getDuration();

/**
* @return {@code true} if this is the remainder activity i.e. the duration
* is {@code null}.
*/
boolean isRemainder();

/**
* Set the duration of the activity.
*
* @param duration
* the new duration. Set to {@code null} for the remainder
* activity.
*/
void setDuration(Duration duration);

/**
* @return the activity's comment.
*/
String getComment();

/**
* Set the activity's comment.
*
* @param comment
* the new comment.
*/
void setComment(String comment);
}
Loading