-
Notifications
You must be signed in to change notification settings - Fork 7
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
Better build and installation support #209
base: master
Are you sure you want to change the base?
Changes from all commits
b61eaaa
1ddd312
4886f3f
11cf7d8
b91070e
b848783
480fb6c
f405787
62fa4ab
014c16f
6753016
9842b14
f36b16e
713cf5d
ab586bd
e7b7148
214a621
c1aab36
37aa04c
73d37cf
791268b
45c5fc6
6458a32
5b375f5
1741cc1
ae51390
31a0cda
05e8944
2c8d08e
a904b5f
13ce050
0780bfd
4e6b747
6124998
fd9f0d1
3895c4c
1b64c1c
e5f8ac6
b7f6acf
ed544cd
87b2fb7
882cfe6
875dbf5
60d41a9
979d6aa
2f17155
e01bbc2
742b6c1
d305ce0
52d976f
537339b
886c0a6
68e88d6
31475f4
b475ce2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Java CI with Maven | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
repository_dispatch: | ||
types: [rebuild] | ||
|
||
jobs: | ||
build: | ||
name: Maven | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 11 | ||
- name: Cache Maven packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
- name: Build with Maven | ||
run: cd edu.cuny.hunter.streamrefactoring.parent && mvn -T 4 -e generate-sources install -DskipTests && cd - | ||
- name: Deploy to GitHub Pages | ||
uses: JamesIves/github-pages-deploy-action@3.7.1 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH: gh-pages # The branch the action should deploy to. | ||
FOLDER: edu.cuny.hunter.streamrefactoring.updatesite/target/repository # The folder the action should deploy. | ||
CLEAN: true # Automatically remove deleted files from the deploy branch |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
khatchad marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<projectDescription> | ||
<name>Optimize-Java-8-Streams-Refactoring</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.m2e.core.maven2Builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.m2e.core.maven2Nature</nature> | ||
</natures> | ||
</projectDescription> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
encoding/<project>=UTF-8 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,43 @@ | ||
sudo: false | ||
install: true | ||
|
||
jdk: | ||
- openjdk8 | ||
|
||
# due to absence of rt.jar and others, code broken for Java >= 9 | ||
# - openjdk11 | ||
|
||
|
||
language: java | ||
jdk: openjdk8 | ||
|
||
before_script: | ||
- echo $JAVA_OPTS | ||
- export JAVA_OPTS='-Xms1g -Xmx3g' | ||
- echo "MAVEN_OPTS='-Xmx3g'" > ~/.mavenrc | ||
|
||
env: | ||
global: | ||
- MAVEN_OPTS="-Xmx3g" | ||
|
||
cache: | ||
apt: true | ||
directories: | ||
- $HOME/.m2 | ||
|
||
services: | ||
- xvfb | ||
script: mvn clean verify -Pjacoco coveralls:report | ||
notifications: | ||
slack: cunyponder:A8GuEoj0voEn2H7MJDL1eNji | ||
- xvfb | ||
|
||
script: | ||
- cd edu.cuny.hunter.streamrefactoring.parent && mvn -e generate-sources install && cd - | ||
- du -sh edu.cuny.hunter.streamrefactoring.updatesite/target/repository | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also saw this in the GH actions build ... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the du is just because sometimes upload might fail a bit silently if the files are too large, it also makes sure it's about the right size (some MB) so it was (maybe) built correctly There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This travis file is obsolete, they stopped offering free service for open source projects so I now only use GH actions. So this file can be deleted it is overridden by the Gh workflow file. |
||
|
||
# this reporting step does not work currently... | ||
# - cd edu.cuny.hunter.streamrefactoring.parent && mvn clean verify -Pjacoco coveralls:report && cd - | ||
|
||
|
||
deploy: | ||
provider: pages | ||
skip_cleanup: true | ||
github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard | ||
local_dir: edu.cuny.hunter.streamrefactoring.updatesite/target/repository | ||
on: | ||
branch: master |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="lib" path="lib/objenesis-2.5.1.jar" sourcepath="lib/objenesis-2.5.1-sources.jar"> | ||
<attributes> | ||
<attribute name="javadoc_location" value="jar:platform:/resource/edu.cuny.hunter.streamrefactoring.core/lib/objenesis-2.5.1-javadoc.jar!/"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,18 +2,14 @@ Manifest-Version: 1.0 | |
Bundle-ManifestVersion: 2 | ||
Bundle-Name: %Bundle-Name | ||
Bundle-SymbolicName: edu.cuny.hunter.streamrefactoring.core;singleton:=true | ||
Bundle-Version: 1.9.0 | ||
Bundle-Version: 2.0.0.qualifier | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||
Bundle-Vendor: %Bundle-Vendor | ||
Bundle-ClassPath: ., | ||
lib/objenesis-2.5.1.jar | ||
Bundle-ClassPath: . | ||
Require-Bundle: org.eclipse.ltk.core.refactoring, | ||
org.eclipse.equinox.registry, | ||
org.eclipse.jdt.core, | ||
org.eclipse.osgi, | ||
edu.cuny.citytech.refactoring.common.core;bundle-version="1.1.0", | ||
org.eclipse.jdt.ui, | ||
org.eclipse.jface;bundle-version="3.11.0", | ||
com.google.guava, | ||
com.ibm.wala.ide;bundle-version="1.3.10", | ||
com.ibm.wala.ide.jdt;bundle-version="1.3.10", | ||
|
@@ -22,24 +18,20 @@ Require-Bundle: org.eclipse.ltk.core.refactoring, | |
com.ibm.wala.shrike;bundle-version="1.3.10", | ||
com.ibm.safe.core;bundle-version="1.0.0", | ||
com.ibm.safe.typestate;bundle-version="1.0.0", | ||
org.eclipse.jdt.launching | ||
org.eclipse.jdt.launching, | ||
org.eclipse.core.resources, | ||
org.eclipse.core.runtime, | ||
org.eclipse.jdt.core.manipulation, | ||
org.eclipse.text, | ||
org.eclipse.ui, | ||
org.eclipse.pde.core, | ||
org.objenesis | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How does this get here? I see that the jar is removed, but now it is being referenced as a plug-in. Where did the plug-in come from? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess you mean the objenesis dependency. The plugin is resolved directly in the Nexus central : A lot of third-party artifacts are released there, among which is this objenesis dependency. https://mvnrepository.com/artifact/org.objenesis/objenesis This is not as good as grabbing it from Orbit, because Orbit is a "simultaneous release" of components that are tested and interact well together and with the version of eclipse platform we are targetting. But it avoids at least repackaging our own, and lets us update automatically if a new version is released to maven central. It certainly is better than having a copy of the jar in our lib/ folder. |
||
Export-Package: edu.cuny.hunter.streamrefactoring.core.analysis, | ||
edu.cuny.hunter.streamrefactoring.core.contributions, | ||
edu.cuny.hunter.streamrefactoring.core.descriptors, | ||
edu.cuny.hunter.streamrefactoring.core.messages, | ||
edu.cuny.hunter.streamrefactoring.core.refactorings, | ||
edu.cuny.hunter.streamrefactoring.core.utils, | ||
edu.cuny.hunter.streamrefactoring.core.wala | ||
Import-Package: com.ibm.safe.controller, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's wrong with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Import-Package" means that this particular package should exist in the platform, but you are not specifying the plugin that provides it. The problem is then to find a "bundle" or plugin that provides the required package. We can resolve such artifacts in the update sites we provide to maven : In this place I put the WALA and SAFE repositories, as well as point "orbit" which is an eclipse project providing quite a few common utilities packaged as bundles so we can use them in this kind of integration scenario. e.g. this is where we resolve dependencies on apache stuff https://download.eclipse.org/tools/orbit/downloads/drops/R20200529191137/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, interesting. I didn't know about that. Thanks! |
||
com.ibm.safe.internal.exceptions, | ||
com.ibm.safe.typestate.core, | ||
org.eclipse.core.resources, | ||
org.eclipse.core.runtime;version="3.5.0", | ||
org.eclipse.core.runtime.jobs, | ||
org.eclipse.jdt.core.refactoring, | ||
org.eclipse.jdt.core.refactoring.descriptors, | ||
org.eclipse.jdt.internal.ui, | ||
org.eclipse.jface.text, | ||
org.eclipse.pde.core.plugin, | ||
org.eclipse.text.edits, | ||
org.eclipse.ui.plugin | ||
Bundle-ActivationPolicy: lazy | ||
Bundle-Activator: edu.cuny.streamrefactoring.core.plugin.StreamRefactorCorePlugin |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package edu.cuny.streamrefactoring.core.plugin; | ||
|
||
import java.io.IOException; | ||
import java.net.URI; | ||
import java.net.URISyntaxException; | ||
import java.net.URL; | ||
import java.util.logging.Logger; | ||
|
||
import org.eclipse.core.runtime.FileLocator; | ||
import org.eclipse.core.runtime.Plugin; | ||
import org.osgi.framework.BundleContext; | ||
|
||
public class StreamRefactorCorePlugin extends Plugin { | ||
|
||
// The plug-in ID | ||
public static final String PLUGIN_ID = "edu.cuny.streamrefactoring.core"; //$NON-NLS-1$ | ||
|
||
// The shared instance | ||
private static StreamRefactorCorePlugin plugin; | ||
|
||
private static URI jvmLocalVersionUri = null; | ||
|
||
/** | ||
* The constructor | ||
*/ | ||
public StreamRefactorCorePlugin() { | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
public final void start(BundleContext context) throws Exception { | ||
super.start(context); | ||
plugin = this; | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
public final void stop(BundleContext context) throws Exception { | ||
plugin = null; | ||
super.stop(context); | ||
} | ||
|
||
/** | ||
* Returns the shared instance | ||
* | ||
* @return the shared instance | ||
*/ | ||
public static StreamRefactorCorePlugin getDefault() { | ||
return plugin; | ||
} | ||
|
||
|
||
private static final Logger log = Logger.getLogger(PLUGIN_ID); | ||
|
||
public static URI getJVMLocalVersionURI() throws IOException { | ||
if (jvmLocalVersionUri == null) { | ||
String relativePath = "jre/"; | ||
URL toolff = getDefault().getBundle().getResource(relativePath); | ||
if (toolff == null) { | ||
log.severe("unable to find a folder for JRE in path " + relativePath); | ||
throw new IOException("Unable to find the embedded JVM folder " + relativePath + " within bundle "+ getDefault().getBundle()); | ||
} | ||
URL tmpURL = FileLocator.toFileURL(toolff); | ||
|
||
// use of the multi-argument constructor for URI in order to escape appropriately illegal characters | ||
URI uri; | ||
try { | ||
uri = new URI(tmpURL.getProtocol(), tmpURL.getPath(), null); | ||
} catch (URISyntaxException e) { | ||
throw new IOException("Could not create a URI to access the binary tool :", e); | ||
} | ||
jvmLocalVersionUri = uri; | ||
log.fine("Location of the JRE libs : " + jvmLocalVersionUri); | ||
} | ||
return jvmLocalVersionUri; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>edu.cuny.hunter.streamrefactoring.dev.feature</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.pde.FeatureBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.pde.FeatureNature</nature> | ||
</natures> | ||
</projectDescription> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bin.includes = feature.xml | ||
src.includes = feature.xml,\ | ||
build.properties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, the updatesite is "updated" on each build instead of, let's say, major/minor releases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but if you're considering merging this I should update to "modern" versions for a few of these, the syntax has evolved a bit see
lip6/ITS-commandline@e782ddc#diff-5c3fa597431eda03ac3339ae6bf7f05e1a50d6fc7333679ec38e21b337cb6721R45-R52
for an example