├── .gitignore ├── CONTRIBUTING.md ├── README.md ├── _images ├── chromium_over_eclipse.xcf ├── chromium_over_eclipse_blended.xcf ├── ide-overview.png ├── logo_256.png └── logo_90.png ├── build.gradle ├── buildSrc ├── build.gradle └── src │ ├── main │ └── java │ │ └── buildhelper │ │ ├── CEF.java │ │ └── DownloadAndExtract.java │ └── test │ └── java │ └── buildhelper │ └── CEFTest.java ├── gradle.properties ├── gradle ├── libSetup.gradle ├── loadProps.gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── ide └── build.gradle ├── org.eclipse.swt.chromium.cocoa.macosx.x86_64 └── META-INF │ └── MANIFEST.MF ├── org.eclipse.swt.chromium.gtk.linux.x86 └── META-INF │ └── MANIFEST.MF ├── org.eclipse.swt.chromium.gtk.linux.x86_64 └── META-INF │ └── MANIFEST.MF ├── org.eclipse.swt.chromium.win32.win32.x86 └── META-INF │ └── MANIFEST.MF ├── org.eclipse.swt.chromium.win32.win32.x86_64 └── META-INF │ └── MANIFEST.MF ├── org.eclipse.swt.chromium └── META-INF │ └── MANIFEST.MF └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | # mac stuff 2 | *.DS_Store 3 | 4 | # gradle stuff 5 | build/ 6 | .gradle/ 7 | 8 | # eclipse stuff 9 | bin/ 10 | .project 11 | .classpath 12 | .settings/ 13 | 14 | # ignore the cef download 15 | /org.eclipse.swt.chromium.cocoa.macosx.x86_64/cef 16 | /org.eclipse.swt.chromium.gtk.linux.x86_64/cef 17 | /org.eclipse.swt.chromium.gtk.linux.x86/cef 18 | /org.eclipse.swt.chromium.win32.win32.x86_64/cef 19 | /org.eclipse.swt.chromium.win32.win32.x86/cef 20 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to swt-chromium 2 | 3 | We need help!! Here's what we have so far: 4 | 5 | - `gradlew ide` will give you an IDE with JDT, PDE, and CDT, which looks like this: 6 | 7 | ![IDE overview](_images/ide-overview.png) 8 | 9 | - For each platform, you need a CEF3 download (which is pretty big) 10 | + about ~120MB download, extracts to ~400Mb 11 | - `gradlew downloadCEF` will download and extract the CEF3 binaries and headers for your native platform only. 12 | + `gradlew downloadCEF -Pplatforms=all` will download for all, or `-Pplatforms=win32.win32.x86,win32.win32.x86_64` if you want to list them out manually. 13 | + To change the CEF version, take a look at [`gradle.properties`](gradle.properties). 14 | - And that's as far as we are :) You've got projects with the SWT binaries and the CEF binaries, but there's no glue in between yet. It's on its way! 15 | 16 | ## License 17 | 18 | By contributing your code, you agree to license your contribution under the terms of the EPL v1.0: http://www.eclipse.org/legal/epl-v10.html 19 | 20 | ``` 21 | /***************************************************************** 22 | * Copyright (c) 2012, 2013 Texas Instruments and others 23 | * All rights reserved. This program and the accompanying materials 24 | * are made available under the terms of the Eclipse Public License v1.0 25 | * which accompanies this distribution, and is available at 26 | * http://www.eclipse.org/legal/epl-v10.html 27 | * 28 | * Contributors: 29 | * Patrick Chuong (Texas Instruments) - Initial API and implementation 30 | *****************************************************************/ 31 | ``` 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # swt-chromium: Chromium embed for SWT 2 | 3 | This project is dead, because [cefswt](https://github.com/maketechnology/cefswt) is so much better! Latest Chromium embed for SWT on win/mac/linux under the EPL license, working demos already available. 4 | 5 | Please consider donating financially to their project through the Eclipse Foundation to ensure it gets a full SWT Browser API, including javascript interaction. More details [here](https://github.com/diffplug/swt-chromium/issues/10). 6 | 7 | -------------------------------------------------------------------------------- /_images/chromium_over_eclipse.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diffplug/swt-chromium/29c37edcac3ac5533cc3ee0698f8cc55b7c3b05f/_images/chromium_over_eclipse.xcf -------------------------------------------------------------------------------- /_images/chromium_over_eclipse_blended.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diffplug/swt-chromium/29c37edcac3ac5533cc3ee0698f8cc55b7c3b05f/_images/chromium_over_eclipse_blended.xcf -------------------------------------------------------------------------------- /_images/ide-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diffplug/swt-chromium/29c37edcac3ac5533cc3ee0698f8cc55b7c3b05f/_images/ide-overview.png -------------------------------------------------------------------------------- /_images/logo_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diffplug/swt-chromium/29c37edcac3ac5533cc3ee0698f8cc55b7c3b05f/_images/logo_256.png -------------------------------------------------------------------------------- /_images/logo_90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diffplug/swt-chromium/29c37edcac3ac5533cc3ee0698f8cc55b7c3b05f/_images/logo_90.png -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { mavenCentral() } 3 | dependencies { 4 | classpath "com.diffplug.gradle:goomph:${VER_GOOMPH}" 5 | } 6 | } 7 | 8 | import com.diffplug.common.swt.os.SwtPlatform 9 | 10 | // The CEF binaries are pretty big, well over a gig for all 11 | // five platforms after they've been extracted. By default, 12 | // only the platform for the currently running platform will 13 | // be downloaded. 14 | // 15 | // If you want all platforms, add this to the command line: -Pplatforms=all 16 | // If you want specific platfroms, add this to the command line: -Pplatforms=win32.win32.x86,win32.win32.x86_64 17 | // If you just want the currently running platform, no command line arguments are needed 18 | 19 | // parse the 'platforms' arg 20 | ext.activePlatforms = buildhelper.CEF.parsePlatformsArg(findProperty('platforms')) 21 | 22 | // download the SWT binaries that we're based on 23 | apply plugin: 'com.diffplug.gradle.p2.asmaven' 24 | p2AsMaven { 25 | group 'p2swt', { 26 | repoEclipse VER_SWT 27 | for (SwtPlatform platform : SwtPlatform.getAll()) { 28 | iu "org.eclipse.swt.${platform}" 29 | iu "org.eclipse.swt.${platform}.source" 30 | } 31 | } 32 | } 33 | 34 | // setup the aggregator lib 35 | project(':org.eclipse.swt.chromium') { 36 | apply from: rootProject.file('gradle/libSetup.gradle') 37 | dependencies { 38 | provided project(":org.eclipse.swt.chromium.${SwtPlatform.getNative()}") 39 | 40 | testCompile "junit:junit:${VER_JUNIT}" 41 | testCompile "org.assertj:assertj-core:${VER_ASSERTJ}" 42 | } 43 | } 44 | 45 | // setup the platform-specific fragments 46 | configure(subprojects.findAll {it.name.startsWith('org.eclipse.swt.chromium.')} ) { 47 | apply from: rootProject.file('gradle/libSetup.gradle') 48 | 49 | // add the SWT dependencies 50 | SwtPlatform platform = SwtPlatform.parseWsOsArch(project.name.substring('org.eclipse.swt.chromium.'.length())) 51 | dependencies { 52 | provided "p2swt:org.eclipse.swt:+" 53 | provided "p2swt:org.eclipse.swt.${platform}:+" 54 | } 55 | 56 | // platform-specific libs should be OSGi fragments 57 | jar.manifest.attributes ( 58 | 'Fragment-Host': 'org.eclipse.swt.chromium', 59 | 'Eclipse-PlatformFilter': platform.platformFilter(), 60 | ) 61 | 62 | // download and extract the CEF binaries 63 | if (activePlatforms.contains(platform)) { 64 | buildhelper.CEF.downloadTask(project, platform, 'cef') 65 | } 66 | } 67 | 68 | // setup the root eclipse project 69 | apply plugin: 'com.diffplug.gradle.eclipse.resourcefilters' 70 | eclipseResourceFilters { 71 | exclude().folders().name('org.eclipse.*') 72 | exclude().folders().name('buildSrc') 73 | } 74 | -------------------------------------------------------------------------------- /buildSrc/build.gradle: -------------------------------------------------------------------------------- 1 | apply from: '../gradle/loadProps.gradle' 2 | 3 | repositories { 4 | mavenCentral() 5 | } 6 | 7 | apply plugin: 'java-gradle-plugin' 8 | apply plugin: 'eclipse' 9 | 10 | dependencies { 11 | compile "com.diffplug.gradle:goomph:${VER_GOOMPH}" 12 | compile "org.apache.httpcomponents:httpclient:${VER_HTTPCLIENT}" 13 | compile "org.apache.commons:commons-compress:1.0" 14 | testCompile "junit:junit:${VER_JUNIT}" 15 | testCompile "org.assertj:assertj-core:${VER_ASSERTJ}" 16 | } 17 | -------------------------------------------------------------------------------- /buildSrc/src/main/java/buildhelper/CEF.java: -------------------------------------------------------------------------------- 1 | package buildhelper; 2 | 3 | import java.io.File; 4 | import java.util.HashSet; 5 | import java.util.Set; 6 | 7 | import org.gradle.api.Nullable; 8 | import org.gradle.api.Project; 9 | import org.gradle.api.Task; 10 | import org.gradle.api.tasks.Delete; 11 | 12 | import com.diffplug.common.swt.os.OS; 13 | import com.diffplug.common.swt.os.SwtPlatform; 14 | 15 | /** Miscellany for downloading and extracting the CEF. */ 16 | public class CEF { 17 | /** 18 | * null -> the running platform 19 | * 'all' -> all platforms 20 | * 'win32.win32.x86,win32.win32.x86_64' -> those platforms 21 | */ 22 | public static Set parsePlatformsArg(@Nullable String platforms) { 23 | Set result = new HashSet<>(); 24 | if (platforms == null) { 25 | result.add(SwtPlatform.getRunning()); 26 | } else if (platforms.equals("all")) { 27 | result.addAll(SwtPlatform.getAll()); 28 | } else { 29 | for (String platform : platforms.split(",")) { 30 | result.add(SwtPlatform.parseWsOsArch(platform)); 31 | } 32 | 33 | } 34 | return result; 35 | } 36 | 37 | /** Converts an SwtPlatform back to an OS. */ 38 | static OS toOS(SwtPlatform platform) { 39 | for (OS os : OS.values()) { 40 | if (SwtPlatform.fromOS(os).equals(platform)) { 41 | return os; 42 | } 43 | } 44 | throw new IllegalArgumentException("No known OS matches this platform: " + platform); 45 | } 46 | 47 | /** Converts an SwtPlatform back to an OS. */ 48 | public static String cefUrl(String cefVersion, SwtPlatform platform, boolean minimal) { 49 | OS os = toOS(platform); 50 | String plat = os.winMacLinux("windows", "macosx", "linux") + os.getArch().x86x64("32", "64"); 51 | String min = minimal ? "_minimal" : ""; 52 | return "http://opensource.spotify.com/cefbuilds/cef_binary_" + cefVersion + "_" + plat + min + ".tar.bz2"; 53 | } 54 | 55 | private static String prop(Project proj, String prop) { 56 | return (String) proj.property(prop); 57 | } 58 | 59 | /** Returns a task which will download and extract the CEF binaries for the given platform into the given folder. */ 60 | public static Task downloadTask(Project project, SwtPlatform platform, Object destFolder) { 61 | String cefVersion = prop(project, "VER_CEF"); 62 | boolean isMinimal = Boolean.parseBoolean(prop(project, "CEF_MINIMAL")); 63 | File folder = project.file(destFolder); 64 | 65 | project.getTasks().create("cleanCEF", Delete.class, task -> { 66 | task.delete(folder); 67 | }); 68 | 69 | return project.getTasks().create("downloadCEF", DownloadAndExtract.class, task -> { 70 | task.setup(cefUrl(cefVersion, platform, isMinimal), folder); 71 | }); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /buildSrc/src/main/java/buildhelper/DownloadAndExtract.java: -------------------------------------------------------------------------------- 1 | package buildhelper; 2 | 3 | import java.io.BufferedInputStream; 4 | import java.io.File; 5 | import java.io.FileInputStream; 6 | import java.io.FileNotFoundException; 7 | import java.io.FileOutputStream; 8 | import java.io.IOException; 9 | import java.io.InputStream; 10 | import java.io.InputStreamReader; 11 | import java.io.Reader; 12 | import java.lang.reflect.Method; 13 | import java.nio.charset.StandardCharsets; 14 | import java.util.Date; 15 | import java.util.function.Consumer; 16 | 17 | import org.apache.commons.compress.archivers.tar.TarArchiveEntry; 18 | import org.apache.commons.compress.archivers.tar.TarArchiveInputStream; 19 | import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream; 20 | import org.apache.http.HttpEntity; 21 | import org.apache.http.client.methods.CloseableHttpResponse; 22 | import org.apache.http.client.methods.HttpGet; 23 | import org.apache.http.impl.client.CloseableHttpClient; 24 | import org.apache.http.impl.client.HttpClients; 25 | import org.gradle.api.DefaultTask; 26 | import org.gradle.api.GradleException; 27 | import org.gradle.api.tasks.Input; 28 | import org.gradle.api.tasks.OutputFile; 29 | import org.gradle.api.tasks.TaskAction; 30 | import org.gradle.internal.logging.progress.ProgressLogger; 31 | import org.gradle.internal.logging.progress.ProgressLoggerFactory; 32 | 33 | import com.diffplug.common.base.Box; 34 | import com.diffplug.common.base.Errors; 35 | import com.diffplug.common.base.Preconditions; 36 | import com.diffplug.common.base.StringPrinter; 37 | import com.diffplug.common.base.Throwing; 38 | import com.diffplug.common.hash.HashCode; 39 | import com.diffplug.common.hash.Hashing; 40 | import com.diffplug.common.io.CharStreams; 41 | import com.diffplug.common.io.Files; 42 | import com.diffplug.gradle.FileMisc; 43 | 44 | /** 45 | * Downloads and extracts a .tar.bz2, 46 | * while keeping the root folder out, 47 | * with fast directory caching. 48 | * 49 | * Progress reporting ripped from Michel Kraemer's [gradle-download-task](https://github.com/michel-kraemer/gradle-download-task/blob/master/src/main/java/de/undercouch/gradle/tasks/download/DownloadAction.java), many thanks. 50 | */ 51 | public class DownloadAndExtract extends DefaultTask { 52 | @Input 53 | public String getUrl() { 54 | return url; 55 | } 56 | 57 | @Input 58 | public String getShaUrl() { 59 | return shaUrl; 60 | } 61 | 62 | @OutputFile 63 | public File getCompletedToken() { 64 | return completedToken; 65 | } 66 | 67 | private String url, shaUrl; 68 | private File destinationFolder, completedToken; 69 | 70 | void setup(String url, File destinationFolder) { 71 | setup(url, url + ".sha1", destinationFolder); 72 | } 73 | 74 | void setup(String url, String shaUrl, File destinationFolder) { 75 | this.url = url; 76 | this.shaUrl = shaUrl; 77 | this.destinationFolder = destinationFolder; 78 | completedToken = new File(destinationFolder, "README.md"); 79 | } 80 | 81 | private ProgressLogger logger; 82 | 83 | @TaskAction 84 | public void downloadAndExtract() throws IOException { 85 | File downloadFile = new File(destinationFolder, url.substring(url.lastIndexOf('/') + 1)); 86 | File extractFolder = new File(destinationFolder, "extracted"); 87 | 88 | // find the sha we're expecting 89 | logHeader("Downloading expected sha1..."); 90 | String sha1 = getSha(shaUrl); 91 | 92 | // find the file that should have been downloaded 93 | if (downloadFile.exists()) { 94 | logHeader("File already exists, calculating hash..."); 95 | if (checkSha(downloadFile, sha1)) { 96 | log("...matches!"); 97 | } else { 98 | FileMisc.forceDelete(downloadFile); 99 | } 100 | } 101 | 102 | // download the file if we don't have it 103 | if (!downloadFile.exists()) { 104 | logHeader("Downloading"); 105 | download(url, downloadFile, this::log); 106 | logHeader("Checking hash..."); 107 | if (checkSha(downloadFile, sha1)) { 108 | log("...matches!"); 109 | } else { 110 | throw new GradleException("Downloaded file did not match sha"); 111 | } 112 | } 113 | 114 | // uncompress the file we downloaded 115 | logHeader("Extracting"); 116 | FileMisc.cleanDir(extractFolder); 117 | uncompress(downloadFile, extractFolder); 118 | 119 | // flatten for consistent filenames 120 | File[] children = extractFolder.listFiles(); 121 | Preconditions.checkArgument(children.length == 1, children); 122 | FileMisc.flatten(children[0]); 123 | 124 | // write out the completed token 125 | Files.write(StringPrinter.buildString(printer -> { 126 | printer.println("Downloaded on " + new Date()); 127 | printer.println("From " + url); 128 | printer.println("Verified hash " + sha1 + " obtained from " + shaUrl); 129 | }), completedToken, StandardCharsets.UTF_8); 130 | endLog(); 131 | } 132 | 133 | static void uncompress(File toUncompress, File destinationDir) throws FileNotFoundException, IOException { 134 | byte[] buffer = new byte[BUFFER_SIZE]; 135 | // extract the downloaded file 136 | try (TarArchiveInputStream untarred = new TarArchiveInputStream( 137 | new BZip2CompressorInputStream( 138 | new BufferedInputStream( 139 | new FileInputStream(toUncompress))))) { 140 | TarArchiveEntry entry; 141 | while((entry = untarred.getNextTarEntry()) != null) { 142 | File target = new File(destinationDir, entry.getName()); 143 | if (entry.isDirectory()) { 144 | FileMisc.mkdirs(target); 145 | } else { 146 | long size = entry.getSize(); 147 | long totalRead = 0; 148 | try (FileOutputStream output = new FileOutputStream(target)) { 149 | while (totalRead < size) { 150 | int numRead = untarred.read(buffer); 151 | output.write(buffer, 0, numRead); 152 | totalRead += numRead; 153 | } 154 | } 155 | } 156 | } 157 | } 158 | } 159 | 160 | private boolean checkSha(File file, String sha1) throws IOException { 161 | HashCode calculated = Files.hash(file, Hashing.sha1()); 162 | if (calculated.toString().equals(sha1)) { 163 | return true; 164 | } else { 165 | log("...hash failed, was " + calculated + ", expected " + sha1); 166 | return false; 167 | } 168 | } 169 | 170 | static String getSha(String url) throws IOException { 171 | Box.Nullable result = Box.Nullable.ofNull(); 172 | httpGet(url, entity -> { 173 | try (Reader reader = new InputStreamReader(entity.getContent(), StandardCharsets.UTF_8)) { 174 | result.set(CharStreams.toString(reader)); 175 | } 176 | }); 177 | return result.get(); 178 | } 179 | 180 | private static final int BUFFER_SIZE = 8192; 181 | 182 | static void download(String url, File destination, Consumer monitor) throws IOException { 183 | monitor.accept("Connecting"); 184 | httpGet(url, entity -> { 185 | String toRead = " / " + toKbMbGb(entity.getContentLength()); 186 | monitor.accept("0" + toRead); 187 | long totalRead = 0; 188 | FileMisc.mkdirs(destination.getParentFile()); 189 | byte[] buffer = new byte[BUFFER_SIZE]; 190 | try ( InputStream input = new BufferedInputStream(entity.getContent()); 191 | FileOutputStream output = new FileOutputStream(destination)) { 192 | int numRead; 193 | while ((numRead = input.read(buffer)) >= 0) { 194 | output.write(buffer, 0, numRead); 195 | totalRead += numRead; 196 | monitor.accept(toKbMbGb(totalRead) + toRead); 197 | } 198 | } 199 | }); 200 | } 201 | 202 | static void httpGet(String url, Throwing.Specific.Consumer consume) throws IOException { 203 | CloseableHttpClient httpClient = HttpClients.createDefault(); 204 | HttpGet get = new HttpGet(url); 205 | try (CloseableHttpResponse response = httpClient.execute(get)) { 206 | HttpEntity entity = response.getEntity(); 207 | consume.accept(entity); 208 | } 209 | } 210 | 211 | ///////////// 212 | // logging // 213 | //////////// 214 | private void logHeader(String header) { 215 | if (logger != null) { 216 | endLog(); 217 | } 218 | ProgressLoggerFactory factory = invoke(invoke(getProject(), "getServices"), "get", ProgressLoggerFactory.class); 219 | logger = factory.newOperation(header); 220 | logger.setDescription(header); 221 | logger.setLoggingHeader(header); 222 | logger.started(); 223 | } 224 | 225 | private void log(String progress) { 226 | logger.progress(progress); 227 | } 228 | 229 | private void endLog() { 230 | logger.completed(); 231 | logger = null; 232 | } 233 | 234 | @SuppressWarnings("unchecked") 235 | private static T invoke(Object obj, String method, Object... args) { 236 | Class[] argumentTypes = new Class[args.length]; 237 | for (int i = 0; i < args.length; ++i) { 238 | argumentTypes[i] = args[i].getClass(); 239 | } 240 | return Errors.rethrow().get(() -> { 241 | Method m = obj.getClass().getMethod(method, argumentTypes); 242 | m.setAccessible(true); 243 | return (T) m.invoke(obj, args); 244 | }); 245 | } 246 | 247 | static String toKbMbGb(long bytes) { 248 | if (bytes < 1024) { 249 | return bytes + " B"; 250 | } else if (bytes < 1024 * 1024) { 251 | return (bytes / 1024) + " KB"; 252 | } else if (bytes < 1024 * 1024 * 1024) { 253 | return String.format("%.2f MB", bytes / (1024.0 * 1024.0)); 254 | } else { 255 | return String.format("%.2f GB", bytes / (1024.0 * 1024.0 * 1024.0)); 256 | } 257 | } 258 | } 259 | -------------------------------------------------------------------------------- /buildSrc/src/test/java/buildhelper/CEFTest.java: -------------------------------------------------------------------------------- 1 | package buildhelper; 2 | 3 | import org.assertj.core.api.Assertions; 4 | import org.junit.Assert; 5 | import org.junit.Test; 6 | 7 | import com.diffplug.common.swt.os.OS; 8 | import com.diffplug.common.swt.os.SwtPlatform; 9 | 10 | public class CEFTest { 11 | @Test 12 | public void testToOs() { 13 | for (OS os : OS.values()) { 14 | SwtPlatform platform = SwtPlatform.fromOS(os); 15 | Assert.assertEquals(os, CEF.toOS(platform)); 16 | } 17 | } 18 | 19 | private void testParsePlatformsArg(String arg, SwtPlatform... expected) { 20 | Assertions.assertThat(CEF.parsePlatformsArg(arg)).containsExactlyInAnyOrder(expected); 21 | } 22 | 23 | @Test 24 | public void testParsePlatformsArg() { 25 | testParsePlatformsArg(null, SwtPlatform.getRunning()); 26 | testParsePlatformsArg("win32.win32.x86", SwtPlatform.fromOS(OS.WIN_x86)); 27 | testParsePlatformsArg("win32.win32.x86,win32.win32.x86_64", SwtPlatform.fromOS(OS.WIN_x86), SwtPlatform.fromOS(OS.WIN_x64)); 28 | testParsePlatformsArg("all", SwtPlatform.getAll().toArray(new SwtPlatform[0])); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | stable=unreleased 2 | version=1.0.0-SNAPSHOT 3 | name=goomph 4 | group=com.diffplug.swt.chromium 5 | description=Chromium browser embed 6 | org=diffplug 7 | 8 | # base SWT version 9 | VER_SWT=4.6.0 10 | 11 | # base CEF version (http://opensource.spotify.com/cefbuilds/index.html) 12 | # published 3/10/2017 13 | VER_CEF=3.2987.1591.gd3e47f5 14 | 15 | # set to false and download size ~doubles, bonus is debug libs and example app sources 16 | CEF_MINIMAL=true 17 | 18 | # testing libraries 19 | VER_JUNIT=4.12 20 | VER_ASSERTJ=3.5.2 21 | 22 | # build deps 23 | VER_GOOMPH=3.7.1 24 | VER_HTTPCLIENT=4.5.2 25 | VER_COMMONS_COMPRESS=1.12 26 | -------------------------------------------------------------------------------- /gradle/libSetup.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | apply plugin: 'eclipse' 3 | 4 | repositories { 5 | mavenCentral() 6 | maven { 7 | url rootProject.file('build/p2asmaven/maven') 8 | } 9 | } 10 | 11 | configurations { 12 | provided 13 | compile.extendsFrom provided 14 | } 15 | 16 | // setup the OSGi manifest 17 | apply plugin: 'com.diffplug.gradle.osgi.bndmanifest' 18 | osgiBndManifest { 19 | copyTo 'META-INF/MANIFEST.MF' 20 | } 21 | jar.manifest.attributes( 22 | '-exportcontents': 'org.eclipse.*', 23 | '-removeheaders': 'Bnd-LastModified,Bundle-Name,Created-By,Tool,Private-Package', 24 | 'Import-Package': '!javax.annotation.*,*', 25 | 'Bundle-ActivationPolicy': 'lazy', 26 | 'Bundle-License': "http://www.apache.org/licenses/LICENSE-2.0", 27 | 'Bundle-RequiredExecutionEnvironment': 'JavaSE-1.8', 28 | 'Bundle-SymbolicName': "${project.name};singleton:=true", 29 | 'Bundle-Vendor': 'DiffPlug', 30 | 'Require-Capability': 'osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"', 31 | '-nodefaultversion': 'true' 32 | ) 33 | 34 | // exclude the build folder from eclipse projects 35 | apply plugin: 'com.diffplug.gradle.eclipse.resourcefilters' 36 | eclipseResourceFilters { 37 | exclude().folders().name('build') 38 | } 39 | -------------------------------------------------------------------------------- /gradle/loadProps.gradle: -------------------------------------------------------------------------------- 1 | // load the properties for buildSrc 2 | Properties properties = new Properties() 3 | FileInputStream input = new FileInputStream(file('../gradle.properties')) 4 | properties.load(input) 5 | input.close() 6 | 7 | for (String key : properties.stringPropertyNames()) { 8 | ext.set(key, properties.getProperty(key)) 9 | } 10 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diffplug/swt-chromium/29c37edcac3ac5533cc3ee0698f8cc55b7c3b05f/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Nov 24 01:20:53 PST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save ( ) { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /ide/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.diffplug.gradle.oomph.ide' 2 | oomphIde { 3 | splash rootProject.file('_images/logo_256.png') 4 | eclipseIni { 5 | vmargs('-Xmx2g') // IDE can have up to 2 gigs of RAM 6 | } 7 | style { 8 | classicTheme() // oldschool cool 9 | niceText() // with nice fonts and visible whitespace 10 | } 11 | 12 | // setup the jdt 13 | repoEclipseLatest() 14 | pde { 15 | targetplatform { 16 | it.installation rootProject.file('build/p2asmaven/p2/p2swt') 17 | } 18 | } 19 | 20 | // setup the cdt 21 | repo 'http://download.eclipse.org/tools/cdt/releases/9.1' 22 | feature 'org.eclipse.cdt.platform' 23 | 24 | thirdParty { 25 | // syntax highlighting for gradle scripts 26 | minimalistGradleEditor {} 27 | // terminal for running gradle commands 28 | tmTerminal {} 29 | } 30 | 31 | // add these projects 32 | addAllProjects() 33 | } 34 | -------------------------------------------------------------------------------- /org.eclipse.swt.chromium.cocoa.macosx.x86_64/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ActivationPolicy: lazy 3 | Bundle-License: http://www.apache.org/licenses/LICENSE-2.0 4 | Bundle-ManifestVersion: 2 5 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 6 | Bundle-SymbolicName: org.eclipse.swt.chromium.cocoa.macosx.x86_64;sing 7 | leton:=true 8 | Bundle-Vendor: DiffPlug 9 | Bundle-Version: 1.0.0.I201611231438 10 | Eclipse-PlatformFilter: (& (osgi.ws=cocoa) (osgi.os=macosx) (osgi.arch 11 | =x86_64) ) 12 | Fragment-Host: org.eclipse.swt.chromium 13 | Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))" 14 | -------------------------------------------------------------------------------- /org.eclipse.swt.chromium.gtk.linux.x86/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ActivationPolicy: lazy 3 | Bundle-License: http://www.apache.org/licenses/LICENSE-2.0 4 | Bundle-ManifestVersion: 2 5 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 6 | Bundle-SymbolicName: org.eclipse.swt.chromium.gtk.linux.x86;singleton: 7 | =true 8 | Bundle-Vendor: DiffPlug 9 | Bundle-Version: 1.0.0.I201611231438 10 | Eclipse-PlatformFilter: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=x8 11 | 6) ) 12 | Fragment-Host: org.eclipse.swt.chromium 13 | Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))" 14 | -------------------------------------------------------------------------------- /org.eclipse.swt.chromium.gtk.linux.x86_64/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ActivationPolicy: lazy 3 | Bundle-License: http://www.apache.org/licenses/LICENSE-2.0 4 | Bundle-ManifestVersion: 2 5 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 6 | Bundle-SymbolicName: org.eclipse.swt.chromium.gtk.linux.x86_64;singlet 7 | on:=true 8 | Bundle-Vendor: DiffPlug 9 | Bundle-Version: 1.0.0.I201611231438 10 | Eclipse-PlatformFilter: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=x8 11 | 6_64) ) 12 | Fragment-Host: org.eclipse.swt.chromium 13 | Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))" 14 | -------------------------------------------------------------------------------- /org.eclipse.swt.chromium.win32.win32.x86/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ActivationPolicy: lazy 3 | Bundle-License: http://www.apache.org/licenses/LICENSE-2.0 4 | Bundle-ManifestVersion: 2 5 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 6 | Bundle-SymbolicName: org.eclipse.swt.chromium.win32.win32.x86;singleto 7 | n:=true 8 | Bundle-Vendor: DiffPlug 9 | Bundle-Version: 1.0.0.I201611231438 10 | Eclipse-PlatformFilter: (& (osgi.ws=win32) (osgi.os=win32) (osgi.arch= 11 | x86) ) 12 | Fragment-Host: org.eclipse.swt.chromium 13 | Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))" 14 | -------------------------------------------------------------------------------- /org.eclipse.swt.chromium.win32.win32.x86_64/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ActivationPolicy: lazy 3 | Bundle-License: http://www.apache.org/licenses/LICENSE-2.0 4 | Bundle-ManifestVersion: 2 5 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 6 | Bundle-SymbolicName: org.eclipse.swt.chromium.win32.win32.x86_64;singl 7 | eton:=true 8 | Bundle-Vendor: DiffPlug 9 | Bundle-Version: 1.0.0.I201611231438 10 | Eclipse-PlatformFilter: (& (osgi.ws=win32) (osgi.os=win32) (osgi.arch= 11 | x86_64) ) 12 | Fragment-Host: org.eclipse.swt.chromium 13 | Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))" 14 | -------------------------------------------------------------------------------- /org.eclipse.swt.chromium/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ActivationPolicy: lazy 3 | Bundle-License: http://www.apache.org/licenses/LICENSE-2.0 4 | Bundle-ManifestVersion: 2 5 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 6 | Bundle-SymbolicName: org.eclipse.swt.chromium;singleton:=true 7 | Bundle-Vendor: DiffPlug 8 | Bundle-Version: 1.0.0.I201611231438 9 | Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))" 10 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | // source for the build files 2 | include 'buildSrc' 3 | // ide 4 | include 'ide' 5 | // per-platform source 6 | include 'org.eclipse.swt.chromium' 7 | include 'org.eclipse.swt.chromium.cocoa.macosx.x86_64' 8 | include 'org.eclipse.swt.chromium.gtk.linux.x86' 9 | include 'org.eclipse.swt.chromium.gtk.linux.x86_64' 10 | include 'org.eclipse.swt.chromium.win32.win32.x86' 11 | include 'org.eclipse.swt.chromium.win32.win32.x86_64' 12 | --------------------------------------------------------------------------------