Skip to content

Commit

Permalink
Merge pull request #1648 from bardsoftware/prj-4-gpcloud-browser
Browse files Browse the repository at this point in the history
New project file UI
  • Loading branch information
dbarashev committed Feb 20, 2019
2 parents 98f12f2 + 5cb6b9d commit f314658
Show file tree
Hide file tree
Showing 116 changed files with 7,865 additions and 3,942 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
language: java
jdk: openjdk11
script: ./ganttproject-builder/build-travis.sh
branches:
only:
Expand Down
23 changes: 23 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Gradle
# Build your Java project and run tests with Gradle using a Gradle wrapper script.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java

trigger:
- prj-4-gpcloud-browser

pool:
vmImage: 'Ubuntu-16.04'

steps:
- task: Gradle@2
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/TEST-*.xml'
tasks: 'build'
51 changes: 31 additions & 20 deletions biz.ganttproject.core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
// import com.sun.org.apache.xalan.internal.xsltc.compiler.Copy

buildscript {
ext.kotlin_version = '1.2.51'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
ext.kotlin_version = '1.3.+'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

apply plugin: 'java'
apply plugin: 'kotlin'

dependencies {
compile fileTree(dir: project.ext.libDir, include: ['*.jar'])
compile fileTree(dir: project.ext.mvnDir, include: ['*.jar'])
mavenDeps "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
mavenDeps group: 'com.google.guava', name: 'guava', version: '25.1-jre'
compile fileTree(dir: project.ext.libDir, include: ['*.jar'])
compile fileTree(dir: project.ext.mvnDir, include: ['*.jar'])
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.20"
compile "com.google.guava:guava:25.+"
}

sourceSets {
Expand All @@ -28,17 +30,26 @@ sourceSets {
}
}

task copyPlugin(type: Copy) {
into(new File(rootProject.pluginsDir, project.name))
from(jar.outputs.getFiles().getFiles().flatten())
from(fileTree(".")) {
include "plugin.xml"
include "lib/**/*.jar"
include "resources/**"
}
task copyPlugin(dependsOn: assemble) {
doLast {
println "Copying $project.name to $rootProject.pluginsDir"
println "Installing $project.name"
copy {
into(new File(rootProject.pluginsDir, project.name))
from(jar.outputs.getFiles().getFiles().flatten())
from(fileTree(".")) {
include "plugin.xml"
include "resources/**"
}
}
copy {
into(new File(rootProject.pluginsDir, "${project.name}/lib/"))
from(configurations.compileClasspath) {
include "*.jar"
}
}
println "<<< $project.name"
}

}
repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion biz.ganttproject.core/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<library name="biz.ganttproject.core.jar">
<export name="*"/>
</library>
<library name="lib/mvn/*">
<library name="lib/*">
<export name="*"/>
</library>
<library name="resources/">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
Copyright 2018 BarD Software s.r.o
This file is part of GanttProject, an opensource project management tool.
GanttProject is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
GanttProject is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GanttProject. If not, see <http://www.gnu.org/licenses/>.
*/
package biz.ganttproject.core.option;

import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;
import com.google.common.collect.Maps;

import java.util.Map;

/**
* @author dbarashev@bardsoftware.com
*/
public abstract class KeyValueOption extends GPAbstractOption<Map.Entry<String, String>> implements ListOption<Map.Entry<String, String>> {
private static final Function<Map.Entry<String, String>, String> ENTRY_TO_KEY_VALUE = new Function<Map.Entry<String, String>, String>() {
@Override
public String apply(Map.Entry<String, String> entry) {
return String.format("%s = %s", entry.getKey(), entry.getValue());
}
};
private Map<String, String> myMap = Maps.newHashMap();

public KeyValueOption(String id) {
super(id);
}

@Override
public String getPersistentValue() {
return "\n" + Joiner.on('\n').join(Iterables.transform(getValues(), ENTRY_TO_KEY_VALUE)) + "\n";
}

@Override
public void loadPersistentValue(String value) {
myMap.clear();
for (String line : value.split("\n")) {
String[] keyValue = line.split("=");
if (keyValue.length < 2) {
continue;
}
myMap.put(keyValue[0].trim(), keyValue[1].trim());
}
fireChangeValueEvent(new ChangeValueEvent(getID(), null, null, this));
}

@Override
public void setValues(Iterable<Map.Entry<String, String>> values) {
Map oldValue = Maps.newHashMap(myMap);
myMap.clear();
for (Map.Entry<String, String> e : values) {
myMap.put(e.getKey(), e.getValue());
}
fireChangeValueEvent(new ChangeValueEvent(getID(), oldValue, myMap, this));
}

@Override
public Iterable<Map.Entry<String, String>> getValues() {
return myMap.entrySet();
}

public Map<String, String> getKeyValueMap() {
return ImmutableMap.copyOf(myMap);
}
}
31 changes: 21 additions & 10 deletions biz.ganttproject.impex.ical/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ apply plugin: 'java'
apply plugin: 'idea'

dependencies {
compile fileTree(dir: 'lib', include: ['*.jar'])
compile project(':..:ganttproject')
providedCompile project(path: ':ganttproject', configuration: 'exported')
compile 'backport-util-concurrent:backport-util-concurrent:3.1'
compile 'org.mnode.ical4j:ical4j:1.0.3'

compile configurations.providedCompile
}

sourceSets {
Expand All @@ -16,14 +19,22 @@ sourceSets {
}
}

task copyPlugin(type: Copy) {
into(new File(rootProject.pluginsDir, project.name))
from(jar.outputs.getFiles().getFiles().flatten())
from(fileTree(".")) {
include "plugin.xml"
include "lib/**.jar"
}
task copyPlugin(dependsOn: assemble) {
doLast {
println "Copying $project.name to $rootProject.pluginsDir"
println ">>> Installing $project.name"
copy {
into(new File(rootProject.pluginsDir, project.name))
from(jar.outputs.getFiles().getFiles().flatten())
from(fileTree(".")) {
include "plugin.xml"
}
}
copy {
into(new File(rootProject.pluginsDir, "${project.name}/lib/"))
from(configurations.compileClasspath.minus(configurations.providedCompile.resolve())) {
include "*.jar"
}
}
println "<<< $project.name"
}
}
Binary file not shown.
Binary file not shown.
Binary file removed biz.ganttproject.impex.ical/lib/ical4j-1.0.3.jar
Binary file not shown.
48 changes: 21 additions & 27 deletions biz.ganttproject.impex.ical/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin
id="biz.ganttproject.impex.ical"
name="GanttProject ICal import/export"
version="2.8.4"
provider-name="">
id="biz.ganttproject.impex.ical"
name="GanttProject ICal import/export"
version="2.8.4"
provider-name="">

<runtime>
<library name="biz.ganttproject.impex.ical.jar">
<export name="*"/>
</library>
<library name="lib/backport-util-concurrent-3.1.jar">
<export name="*"/>
</library>
<library name="lib/commons-lang-2.6.jar">
<export name="*"/>
</library>
<library name="lib/ical4j-1.0.3.jar">
<export name="*"/>
</library>
</runtime>
<requires>
<import plugin="biz.ganttproject.core"/>
<import plugin="org.eclipse.core.runtime"/>
<import plugin="net.sourceforge.ganttproject"/>
</requires>
<extension
point="net.sourceforge.ganttproject.importer">
<importer class="biz.ganttproject.impex.ical.IcsFileImporter"/>
</extension>
<runtime>
<library name="biz.ganttproject.impex.ical.jar">
<export name="*"/>
</library>
<library name="lib/*">
<export name="*"/>
</library>
</runtime>
<requires>
<import plugin="biz.ganttproject.core"/>
<import plugin="org.eclipse.core.runtime"/>
<import plugin="net.sourceforge.ganttproject"/>
</requires>
<extension
point="net.sourceforge.ganttproject.importer">
<importer class="biz.ganttproject.impex.ical.IcsFileImporter"/>
</extension>
</plugin>
41 changes: 29 additions & 12 deletions biz.ganttproject.impex.msproject2/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
apply plugin: 'java'
apply plugin: 'idea'

dependencies {
compile fileTree(dir: 'lib', include: ['*.jar'])
compile project(':..:ganttproject')
}

sourceSets {
main {
java {
Expand All @@ -16,14 +11,36 @@ sourceSets {
}
}

task copyPlugin(type: Copy) {
into(new File(rootProject.pluginsDir, project.name))
from(jar.outputs.getFiles().getFiles().flatten())
from(fileTree(".")) {
include "plugin.xml"
include "lib/**"
dependencies {
providedCompile project(path: ':ganttproject', configuration: 'exported')
compile('net.sf.mpxj:mpxj:7.4.+') {
exclude group: 'org.xerial', module: 'sqlite-jdbc'
exclude group: 'com.jgoodies'
}
compile 'javax.xml.bind:jaxb-api:2.3.+'
compile 'javax.xml:jaxb-impl:2.1'

compile configurations.providedCompile
compile fileTree(dir: project.ext.libDir, include: ['*.jar'])
}

task copyPlugin(dependsOn: assemble) {
doLast {
println "Copying $project.name to $rootProject.pluginsDir"
println ">>> Installing $project.name"
copy {
into(new File(rootProject.pluginsDir, project.name))
from(jar.outputs.getFiles().getFiles().flatten())
from(fileTree(".")) {
include "plugin.xml"
include "lib/**"
}
}
copy {
into(new File(rootProject.pluginsDir, "${project.name}/lib/"))
from(configurations.compileClasspath.minus(configurations.providedCompile.resolve())) {
include "*.jar"
}
}
println "<<< $project.name"
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed biz.ganttproject.impex.msproject2/lib/mpxj-7.4.2.jar
Binary file not shown.
Binary file removed biz.ganttproject.impex.msproject2/lib/poi-3.17.jar
Binary file not shown.
29 changes: 1 addition & 28 deletions biz.ganttproject.impex.msproject2/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,10 @@
<library name="biz.ganttproject.impex.msproject2.jar">
<export name="*"/>
</library>
<library name="lib/">
<library name="lib/*">
<export name="*">
</export>
</library>
<library name="lib/activation-1.1.1.jar">
<export name="*"/>
</library>
<library name="lib/commons-collections4-4.1.jar">
<export name="*"/>
</library>
<library name="lib/jaxb-api-2.3.0.jar">
<export name="*"/>
</library>
<library name="lib/jaxb-impl-2.0.2.jar">
<export name="*"/>
</library>
<library name="lib/mpxj-7.4.2.jar">
<export
name="*">
</export>
</library>
<library name="lib/poi-3.17.jar">
<export
name="*">
</export>
</library>
<library name="lib/rtfparserkit-1.10.0.jar">
<export
name="*">
</export>
</library>
</runtime>
<requires>
<import plugin="biz.ganttproject.core"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ of the License, or (at your option) any later version.
import biz.ganttproject.core.time.TimeDuration;
import biz.ganttproject.core.time.impl.GPTimeUnitStack;
import biz.ganttproject.core.time.impl.GregorianTimeUnitStack;
import com.beust.jcommander.internal.Maps;
import com.google.common.base.Function;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import net.sf.mpxj.Day;
import net.sf.mpxj.Duration;
import net.sf.mpxj.FieldType;
Expand Down
Loading

0 comments on commit f314658

Please sign in to comment.