http://git-wip-us.apache.org/repos/asf/incubator-netbeans-jackpot30/blob/9ed0a377/language/server/web/language.web.api/nbproject/genfiles.properties ---------------------------------------------------------------------- diff --git a/language/server/web/language.web.api/nbproject/genfiles.properties b/language/server/web/language.web.api/nbproject/genfiles.properties new file mode 100644 index 0000000..58c6c1d --- /dev/null +++ b/language/server/web/language.web.api/nbproject/genfiles.properties @@ -0,0 +1,49 @@ +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +# Copyright 2009-2017 Oracle and/or its affiliates. All rights reserved. +# +# Oracle and Java are registered trademarks of Oracle and/or its affiliates. +# Other names may be trademarks of their respective owners. +# +# The contents of this file are subject to the terms of either the GNU +# General Public License Version 2 only ("GPL") or the Common +# Development and Distribution License("CDDL") (collectively, the +# "License"). You may not use this file except in compliance with the +# License. You can obtain a copy of the License at +# http://www.netbeans.org/cddl-gplv2.html +# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the +# specific language governing permissions and limitations under the +# License. When distributing the software, include this License Header +# Notice in each file and include the License file at +# nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the GPL Version 2 section of the License file that +# accompanied this code. If applicable, add the following below the +# License Header, with the fields enclosed by brackets [] replaced by +# your own identifying information: +# "Portions Copyrighted [year] [name of copyright owner]" +# +# Contributor(s): +# +# The Original Software is NetBeans. The Initial Developer of the Original +# Software is Sun Microsystems, Inc. Portions Copyright 2009-2010 Sun +# Microsystems, Inc. All Rights Reserved. +# +# If you wish your version of this file to be governed by only the CDDL +# or only the GPL Version 2, indicate your decision by adding +# "[Contributor] elects to include this software in this distribution +# under the [CDDL or GPL Version 2] license." If you do not indicate a +# single choice of license, a recipient has the option to distribute +# your version of this file under either the CDDL, the GPL Version 2 or +# to extend the choice of license to its licensees as provided above. +# However, if you add GPL Version 2 code and therefore, elected the GPL +# Version 2 license, then the option applies only if the new code is +# made subject to such option by the copyright holder. +build.xml.data.CRC32=4be6b9c7 +build.xml.script.CRC32=ba5ea644 [email protected] +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=4be6b9c7 +nbproject/build-impl.xml.script.CRC32=2ae307c6 +nbproject/[email protected]
http://git-wip-us.apache.org/repos/asf/incubator-netbeans-jackpot30/blob/9ed0a377/language/server/web/language.web.api/nbproject/project.properties ---------------------------------------------------------------------- diff --git a/language/server/web/language.web.api/nbproject/project.properties b/language/server/web/language.web.api/nbproject/project.properties new file mode 100644 index 0000000..ced83f9 --- /dev/null +++ b/language/server/web/language.web.api/nbproject/project.properties @@ -0,0 +1,161 @@ +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +# Copyright 2009-2017 Oracle and/or its affiliates. All rights reserved. +# +# Oracle and Java are registered trademarks of Oracle and/or its affiliates. +# Other names may be trademarks of their respective owners. +# +# The contents of this file are subject to the terms of either the GNU +# General Public License Version 2 only ("GPL") or the Common +# Development and Distribution License("CDDL") (collectively, the +# "License"). You may not use this file except in compliance with the +# License. You can obtain a copy of the License at +# http://www.netbeans.org/cddl-gplv2.html +# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the +# specific language governing permissions and limitations under the +# License. When distributing the software, include this License Header +# Notice in each file and include the License file at +# nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the GPL Version 2 section of the License file that +# accompanied this code. If applicable, add the following below the +# License Header, with the fields enclosed by brackets [] replaced by +# your own identifying information: +# "Portions Copyrighted [year] [name of copyright owner]" +# +# Contributor(s): +# +# The Original Software is NetBeans. The Initial Developer of the Original +# Software is Sun Microsystems, Inc. Portions Copyright 2009-2010 Sun +# Microsystems, Inc. All Rights Reserved. +# +# If you wish your version of this file to be governed by only the CDDL +# or only the GPL Version 2, indicate your decision by adding +# "[Contributor] elects to include this software in this distribution +# under the [CDDL or GPL Version 2] license." If you do not indicate a +# single choice of license, a recipient has the option to distribute +# your version of this file under either the CDDL, the GPL Version 2 or +# to extend the choice of license to its licensees as provided above. +# However, if you add GPL Version 2 code and therefore, elected the GPL +# Version 2 license, then the option applies only if the new code is +# made subject to such option by the copyright holder. +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=language.web.api +application.vendor=lahvac +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/language.web.api.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.jackpot-lib-noescape.jar=../../../../cmdline/lib/build/lib/jackpot-lib-noescape.jar +file.reference.org-netbeans-lib-nbjavac.jar=../../../../lib/org-netbeans-lib-nbjavac.jar +file.reference.org-netbeans-modules-java-source.jar=../../../../lib/org-netbeans-modules-java-source.jar +file.reference.org-netbeans-modules-parsing-api.jar=../../../../lib/org-netbeans-modules-parsing-api.jar +file.reference.org-netbeans-modules-parsing-lucene.jar=../../../../lib/org-netbeans-modules-parsing-lucene.jar +file.reference.org-netbeans-spi-java-hints.jar=../../../../lib/org-netbeans-spi-java-hints.jar +file.reference.org-openide-filesystems.jar=../../../../lib/org-openide-filesystems.jar +file.reference.org-openide-util-lookup.jar=../../../../lib/org-openide-util-lookup.jar +file.reference.util-commons.jar=../../../../remoting/ide/api/external/util-commons.jar +file.reference.util-pojson.jar=../../../../remoting/ide/api/external/util-pojson.jar +includes=** +jar.archive.disabled=${jnlp.enabled} +jar.compress=false +jar.index=${jnlp.enabled} +javac.classpath=\ + ${libs.jersey.classpath}:\ + ${libs.lucene.classpath}:\ + ${file.reference.org-netbeans-modules-parsing-api.jar}:\ + ${file.reference.org-openide-filesystems.jar}:\ + ${file.reference.org-netbeans-modules-parsing-lucene.jar}:\ + ${file.reference.util-commons.jar}:\ + ${file.reference.util-pojson.jar}:\ + ${reference.base_web_api.jar}:\ + ${file.reference.org-netbeans-spi-java-hints.jar}:\ + ${libs.javac.classpath}:\ + ${reference.org_netbeans_modules_jackpot30_indexing.module}:\ + ${reference.source_web_api.jar}:\ + ${file.reference.org-netbeans-modules-java-source.jar}:\ + ${libs.freemarker.classpath}:\ + ${file.reference.org-netbeans-lib-nbjavac.jar}:\ + ${reference.resolve_web_api.jar}:\ + ${file.reference.jackpot-lib-noescape.jar}:\ + ${file.reference.org-openide-util-lookup.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.6 +javac.target=1.6 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jnlp.codebase.type=no.codebase +jnlp.descriptor=application +jnlp.enabled=false +jnlp.mixed.code=default +jnlp.offline-allowed=false +jnlp.signed=false +jnlp.signing= +jnlp.signing.alias= +jnlp.signing.keystore= +main.class= +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=false +platform.active=default_platform +project.base_web_api=../../../../remoting/server/web/base.web.api +project.org_netbeans_modules_jackpot30_indexing=../../../ide/indexing +project.resolve_web_api=../../../../remoting/server/web/resolve.web.api +project.source_web_api=../../../../remoting/server/web/source.web.api +reference.base_web_api.jar=${project.base_web_api}/dist/base.web.api.jar +reference.org_netbeans_modules_jackpot30_indexing.module=${project.org_netbeans_modules_jackpot30_indexing}/../build/cluster/modules/org-netbeans-modules-jackpot30-indexing.jar +reference.resolve_web_api.jar=${project.resolve_web_api}/dist/resolve.web.api.jar +reference.source_web_api.jar=${project.source_web_api}/dist/source.web.api.jar +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test http://git-wip-us.apache.org/repos/asf/incubator-netbeans-jackpot30/blob/9ed0a377/language/server/web/language.web.api/nbproject/project.xml ---------------------------------------------------------------------- diff --git a/language/server/web/language.web.api/nbproject/project.xml b/language/server/web/language.web.api/nbproject/project.xml new file mode 100644 index 0000000..47ebde0 --- /dev/null +++ b/language/server/web/language.web.api/nbproject/project.xml @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +Copyright 2009-2017 Oracle and/or its affiliates. All rights reserved. + +Oracle and Java are registered trademarks of Oracle and/or its affiliates. +Other names may be trademarks of their respective owners. + +The contents of this file are subject to the terms of either the GNU +General Public License Version 2 only ("GPL") or the Common +Development and Distribution License("CDDL") (collectively, the +"License"). You may not use this file except in compliance with the +License. You can obtain a copy of the License at +http://www.netbeans.org/cddl-gplv2.html +or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the +specific language governing permissions and limitations under the +License. When distributing the software, include this License Header +Notice in each file and include the License file at +nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this +particular file as subject to the "Classpath" exception as provided +by Oracle in the GPL Version 2 section of the License file that +accompanied this code. If applicable, add the following below the +License Header, with the fields enclosed by brackets [] replaced by +your own identifying information: +"Portions Copyrighted [year] [name of copyright owner]" + +Contributor(s): + +The Original Software is NetBeans. The Initial Developer of the Original +Software is Sun Microsystems, Inc. Portions Copyright 2009-2010 Sun +Microsystems, Inc. All Rights Reserved. + +If you wish your version of this file to be governed by only the CDDL +or only the GPL Version 2, indicate your decision by adding +"[Contributor] elects to include this software in this distribution +under the [CDDL or GPL Version 2] license." If you do not indicate a +single choice of license, a recipient has the option to distribute +your version of this file under either the CDDL, the GPL Version 2 or +to extend the choice of license to its licensees as provided above. +However, if you add GPL Version 2 code and therefore, elected the GPL +Version 2 license, then the option applies only if the new code is +made subject to such option by the copyright holder. +--> +<project xmlns="http://www.netbeans.org/ns/project/1"> + <type>org.netbeans.modules.java.j2seproject</type> + <configuration> + <data xmlns="http://www.netbeans.org/ns/j2se-project/3"> + <name>language.web.api</name> + <source-roots> + <root id="src.dir"/> + </source-roots> + <test-roots> + <root id="test.src.dir"/> + </test-roots> + </data> + <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1"> + <definitions>../../../../lib/nblibraries.properties</definitions> + </libraries> + <references xmlns="http://www.netbeans.org/ns/ant-project-references/1"> + <reference> + <foreign-project>base_web_api</foreign-project> + <artifact-type>jar</artifact-type> + <script>build.xml</script> + <target>jar</target> + <clean-target>clean</clean-target> + <id>jar</id> + </reference> + <reference> + <foreign-project>org_netbeans_modules_jackpot30_indexing</foreign-project> + <artifact-type>jar</artifact-type> + <script>build.xml</script> + <target>netbeans</target> + <clean-target>clean</clean-target> + <id>module</id> + </reference> + <reference> + <foreign-project>resolve_web_api</foreign-project> + <artifact-type>jar</artifact-type> + <script>build.xml</script> + <target>jar</target> + <clean-target>clean</clean-target> + <id>jar</id> + </reference> + <reference> + <foreign-project>source_web_api</foreign-project> + <artifact-type>jar</artifact-type> + <script>build.xml</script> + <target>jar</target> + <clean-target>clean</clean-target> + <id>jar</id> + </reference> + </references> + </configuration> +</project> http://git-wip-us.apache.org/repos/asf/incubator-netbeans-jackpot30/blob/9ed0a377/language/server/web/language.web.api/src/org/netbeans/api/java/source/CompilationInfoHack.java ---------------------------------------------------------------------- diff --git a/language/server/web/language.web.api/src/org/netbeans/api/java/source/CompilationInfoHack.java b/language/server/web/language.web.api/src/org/netbeans/api/java/source/CompilationInfoHack.java new file mode 100644 index 0000000..65a91e1 --- /dev/null +++ b/language/server/web/language.web.api/src/org/netbeans/api/java/source/CompilationInfoHack.java @@ -0,0 +1,271 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2009-2010 Sun Microsystems, Inc. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2009-2010 Sun Microsystems, Inc. + */ +package org.netbeans.api.java.source; + +import com.sun.source.tree.CompilationUnitTree; +import com.sun.source.tree.Tree; +import com.sun.source.util.TreePath; +import com.sun.source.util.Trees; +import com.sun.tools.javac.api.JavacTaskImpl; +import com.sun.tools.javac.api.JavacTrees; +import com.sun.tools.javac.code.Source; +import com.sun.tools.javac.model.JavacElements; +import com.sun.tools.javac.model.JavacTypes; +import com.sun.tools.javac.tree.JCTree.JCCompilationUnit; +import com.sun.tools.javac.util.Context; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.lang.model.SourceVersion; +import javax.lang.model.element.Element; +import javax.lang.model.element.TypeElement; +import javax.lang.model.util.Elements; +import javax.lang.model.util.Types; +import javax.swing.text.Document; +import javax.tools.Diagnostic; +import org.netbeans.api.java.classpath.ClassPath; +import org.netbeans.api.java.lexer.JavaTokenId; +import org.netbeans.api.java.source.JavaSource.Phase; +import org.netbeans.api.lexer.TokenHierarchy; +import org.netbeans.modules.java.source.parsing.CompilationInfoImpl; +import org.netbeans.modules.java.source.parsing.HackAccessor; +import org.netbeans.modules.java.source.save.ElementOverlay; +import org.netbeans.modules.parsing.api.Snapshot; +import org.openide.filesystems.FileObject; +import org.openide.filesystems.FileUtil; +import org.openide.util.Exceptions; + +/** + * + * @author lahvac + */ +public class CompilationInfoHack extends WorkingCopy { + + private final Context context; + private final ClasspathInfo cpInfo; + private FileObject file; + private String text; + private TokenHierarchy<?> th; + private final CompilationUnitTree cut; + private PositionConverter conv; + private final org.netbeans.modules.jackpot30.resolve.api.CompilationInfo resolvedInfo; + + public CompilationInfoHack(org.netbeans.modules.jackpot30.resolve.api.CompilationInfo resolvedInfo) { + //TODO: a more sane ClasspathInfo: + this((JavacTaskImpl) resolvedInfo.getJavacTask(), ClasspathInfo.create(ClassPath.EMPTY, ClassPath.EMPTY, ClassPath.EMPTY), (JCCompilationUnit) resolvedInfo.getCompilationUnit(), resolvedInfo); + } + + private CompilationInfoHack(JavacTaskImpl jti, ClasspathInfo cpInfo, JCCompilationUnit cut, org.netbeans.modules.jackpot30.resolve.api.CompilationInfo resolvedInfo) { + super(HackAccessor.createCII(cpInfo), ElementOverlay.getOrCreateOverlay()); + this.context = jti.getContext(); + this.cpInfo = cpInfo; + try { + this.text = cut.sourcefile.getCharContent(false).toString(); + this.file = FileUtil.createMemoryFileSystem().getRoot().createData("Dummy.java");//XXX + Writer w = new OutputStreamWriter(this.file.getOutputStream()); + w.write(this.text); + w.close(); + this.th = TokenHierarchy.create(text, JavaTokenId.language()); + + conv = new PositionConverter(/*SnapshotHack.create(text)*/); + } catch (IllegalArgumentException ex) { + Exceptions.printStackTrace(ex); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + this.cut = cut; + + try { + Field javacTask = CompilationInfoImpl.class.getDeclaredField("javacTask"); + + javacTask.setAccessible(true); + javacTask.set(this.impl, jti); + + Method init = WorkingCopy.class.getDeclaredMethod("init"); + + init.setAccessible(true); + init.invoke(this); + } catch (InvocationTargetException ex) { + Exceptions.printStackTrace(ex); + } catch (NoSuchMethodException ex) { + Exceptions.printStackTrace(ex); + } catch (IllegalArgumentException ex) { + Exceptions.printStackTrace(ex); + } catch (IllegalAccessException ex) { + Exceptions.printStackTrace(ex); + } catch (NoSuchFieldException ex) { + Exceptions.printStackTrace(ex); + } catch (SecurityException ex) { + Exceptions.printStackTrace(ex); + } + this.resolvedInfo = resolvedInfo; + } + + @Override + public TreePath getChangedTree() { + return null; + } + + @Override + public ClasspathInfo getClasspathInfo() { + return cpInfo; + } + + @Override + public CompilationUnitTree getCompilationUnit() { + return cut; + } + + @Override + public List<Diagnostic> getDiagnostics() { + //could be enabled if necessary: + throw new UnsupportedOperationException(); + } + + @Override + public Document getDocument() throws IOException { + return null; + } + + @Override + public synchronized ElementUtilities getElementUtilities() { + return super.getElementUtilities(); + } + + @Override + public Elements getElements() { + return JavacElements.instance(context); + } + + @Override + public FileObject getFileObject() { + return file; + } + + public CompilationInfoImpl getImpl() { + throw new UnsupportedOperationException(); + } + + @Override + public JavaSource getJavaSource() { + throw new UnsupportedOperationException(); + } + + @Override + public Phase getPhase() { + return Phase.RESOLVED; + } + + @Override + public PositionConverter getPositionConverter() { + return conv; + } + + @Override + public Snapshot getSnapshot() { + return org.netbeans.modules.parsing.api.Source.create(file).createSnapshot(); + } + + @Override + public SourceVersion getSourceVersion() { + return Source.toSourceVersion(Source.instance(context)); + } + + @Override + public String getText() { + return text; + } + + @Override + public TokenHierarchy<?> getTokenHierarchy() { + return th; + } + + @Override + public List<? extends TypeElement> getTopLevelElements() throws IllegalStateException { + final List<TypeElement> result = new ArrayList<TypeElement>(); + CompilationUnitTree cu = getCompilationUnit(); + if (cu == null) { + return null; + } + final Trees trees = getTrees(); + assert trees != null; + List<? extends Tree> typeDecls = cu.getTypeDecls(); + TreePath cuPath = new TreePath(cu); + for( Tree t : typeDecls ) { + TreePath p = new TreePath(cuPath,t); + Element e = trees.getElement(p); + if ( e != null && ( e.getKind().isClass() || e.getKind().isInterface() ) ) { + result.add((TypeElement)e); + } + } + return Collections.unmodifiableList(result); + } + + @Override + public synchronized TreeUtilities getTreeUtilities() { + return super.getTreeUtilities(); + } + + @Override + public Trees getTrees() { + return JavacTrees.instance(context); + } + + @Override + public synchronized TypeUtilities getTypeUtilities() { + return super.getTypeUtilities(); + } + + @Override + public Types getTypes() { + return JavacTypes.instance(context); + } + + public Context getContext() { + return context; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-netbeans-jackpot30/blob/9ed0a377/language/server/web/language.web.api/src/org/netbeans/modules/jackpot30/backend/language/api/API.java ---------------------------------------------------------------------- diff --git a/language/server/web/language.web.api/src/org/netbeans/modules/jackpot30/backend/language/api/API.java b/language/server/web/language.web.api/src/org/netbeans/modules/jackpot30/backend/language/api/API.java new file mode 100644 index 0000000..6a96382 --- /dev/null +++ b/language/server/web/language.web.api/src/org/netbeans/modules/jackpot30/backend/language/api/API.java @@ -0,0 +1,215 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2009-2010 Sun Microsystems, Inc. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2009-2010 Sun Microsystems, Inc. + */ + +package org.netbeans.modules.jackpot30.backend.language.api; + +import com.sun.source.tree.Tree; +import com.sun.tools.javac.api.JavacTaskImpl; +import java.io.IOException; +import java.net.URI; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; +import javax.tools.Diagnostic; +import javax.tools.JavaCompiler; +import javax.tools.JavaFileObject; +import javax.tools.JavaFileObject.Kind; +import javax.tools.SimpleJavaFileObject; +import javax.tools.ToolProvider; +import javax.ws.rs.DefaultValue; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import org.apache.lucene.queryParser.ParseException; +import org.netbeans.api.java.source.CompilationInfoHack; +import org.netbeans.lib.nbjavac.services.NBParserFactory; +import org.netbeans.lib.nbjavac.services.NBTreeMaker; +import org.netbeans.modules.jackpot30.backend.base.CategoryStorage; +import org.netbeans.modules.jackpot30.indexing.index.IndexQuery; +import org.netbeans.modules.jackpot30.resolve.api.CompilationInfo; +import org.netbeans.modules.jackpot30.resolve.api.ResolveService; +import org.netbeans.modules.java.hints.declarative.DeclarativeHintsParser; +import org.netbeans.modules.java.hints.jackpot.spi.PatternConvertor; +import org.netbeans.modules.java.hints.providers.spi.HintDescription; +import org.netbeans.modules.java.hints.providers.spi.HintDescription.AdditionalQueryConstraints; +import org.netbeans.modules.java.hints.providers.spi.Trigger.PatternDescription; +import org.netbeans.modules.java.hints.spiimpl.Utilities; +import org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker; +import org.netbeans.modules.java.hints.spiimpl.options.HintsSettings; +import org.netbeans.modules.java.hints.spiimpl.pm.BulkSearch; +import org.netbeans.modules.java.hints.spiimpl.pm.BulkSearch.BulkPattern; +import org.netbeans.spi.editor.hints.ErrorDescription; + +/** + * + * @author lahvac + */ +@Path("/index/language") +public class API { + + static { + DeclarativeHintsParser.disableCustomCode = true; + } + + @GET + @Path("/search") + @Produces("text/plain") + public String find(@QueryParam("path") String segment, @QueryParam("pattern") String pattern, @QueryParam("validate") @DefaultValue("false") boolean validate) throws IOException, InterruptedException, ParseException { + CategoryStorage category = CategoryStorage.forId(segment); + Iterable<? extends HintDescription> hints = PatternConvertor.create(pattern); + BulkPattern bulkPattern = preparePattern(hints, null); + StringBuilder sb = new StringBuilder(); + List<String> candidates = new ArrayList<String>(IndexQuery.performLocalQuery(category.getIndex(), bulkPattern, false).keySet()); + Collections.sort(candidates); + + for (String candidate : candidates) { + if (validate) { + CompilationInfo resolvedInfo = ResolveService.parse(segment, candidate); + CompilationInfoHack info = new CompilationInfoHack(resolvedInfo); + List<ErrorDescription> computedHints = new HintsInvoker(HintsSettings.getGlobalSettings(), new AtomicBoolean()).computeHints(info, hints); + + if (computedHints.isEmpty()) continue; + } + + sb.append(candidate); + sb.append("\n"); + } + + return sb.toString(); + } + + @GET + @Path("/searchSpans") + @Produces("text/plain") + public String findSpans(@QueryParam("path") String segment, @QueryParam("relativePath") String relativePath, @QueryParam("pattern") String pattern) throws IOException, InterruptedException { + StringBuilder sb = new StringBuilder(); + CompilationInfo resolvedInfo = ResolveService.parse(segment, relativePath); + CompilationInfoHack info = new CompilationInfoHack(resolvedInfo); + Iterable<? extends HintDescription> hints = PatternConvertor.create(pattern); + + List<ErrorDescription> computedHints = new HintsInvoker(HintsSettings.getGlobalSettings(), new AtomicBoolean()).computeHints(info, hints); + + for (ErrorDescription ed : computedHints) { + if (!ed.getFile().equals(info.getFileObject())) continue; + sb.append(ed.getRange().getBegin().getOffset()); + sb.append(":"); + sb.append(ed.getRange().getEnd().getOffset()); + sb.append(":"); + } + + if (sb.length() > 0) { + sb.delete(sb.length() - 1, sb.length()); + } + + return sb.toString(); + } + + @GET + @Path("/errors") + @Produces("text/plain") + public String errors(@QueryParam("pattern") String pattern) throws IOException { + StringBuilder sb = new StringBuilder(); + Collection<Diagnostic<? extends JavaFileObject>> errors = new LinkedList<Diagnostic<? extends JavaFileObject>>(); + + preparePattern(pattern, errors); + + for (Diagnostic<? extends JavaFileObject> d : errors) { + sb.append(d.getMessage(null)); + sb.append("\n"); + } + + return sb.toString(); + } + + private static BulkPattern preparePattern(String pattern, Collection<Diagnostic<? extends JavaFileObject>> errors) { + return preparePattern(PatternConvertor.create(pattern), errors); + } + + //XXX: copied from BatchSearch, may be possible to merge once CompilationInfo is accessible in server mode + private static BulkPattern preparePattern(final Iterable<? extends HintDescription> patterns, Collection<Diagnostic<? extends JavaFileObject>> errors) { + return preparePattern(prepareJavacTaskImpl(), patterns, errors); + } + + private static BulkPattern preparePattern(JavacTaskImpl javac, final Iterable<? extends HintDescription> patterns, Collection<Diagnostic<? extends JavaFileObject>> errors) { + Collection<String> code = new LinkedList<String>(); + Collection<Tree> trees = new LinkedList<Tree>(); + Collection<AdditionalQueryConstraints> additionalConstraints = new LinkedList<AdditionalQueryConstraints>(); + + for (HintDescription pattern : patterns) { + String textPattern = ((PatternDescription) pattern.getTrigger()).getPattern(); + + code.add(textPattern); + trees.add(Utilities.parseAndAttribute(javac, textPattern, errors)); + additionalConstraints.add(pattern.getAdditionalConstraints()); + } + + return BulkSearch.getDefault().create(code, trees, additionalConstraints, new AtomicBoolean()); + } + + private static JavacTaskImpl prepareJavacTaskImpl() { + final String bootPath = System.getProperty("sun.boot.class.path"); //NOI18N + final JavaCompiler tool = ToolProvider.getSystemJavaCompiler(); + + assert tool != null; + + JavacTaskImpl ct = (JavacTaskImpl) tool.getTask(null, null, null, Arrays.asList("-bootclasspath", bootPath, "-Xjcov"), null, Collections.<JavaFileObject>emptyList()); + + NBParserFactory.preRegister(ct.getContext()); + NBTreeMaker.preRegister(ct.getContext()); + + return ct; + } + + private static final class JFOImpl extends SimpleJavaFileObject { + private final CharSequence code; + public JFOImpl(CharSequence code) { + super(URI.create(""), Kind.SOURCE); + this.code = code; + } + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException { + return code; + } + } +} http://git-wip-us.apache.org/repos/asf/incubator-netbeans-jackpot30/blob/9ed0a377/language/server/web/language.web.api/src/org/netbeans/modules/jackpot30/backend/language/api/JavacCreatorImpl.java ---------------------------------------------------------------------- diff --git a/language/server/web/language.web.api/src/org/netbeans/modules/jackpot30/backend/language/api/JavacCreatorImpl.java b/language/server/web/language.web.api/src/org/netbeans/modules/jackpot30/backend/language/api/JavacCreatorImpl.java new file mode 100644 index 0000000..291ddb6 --- /dev/null +++ b/language/server/web/language.web.api/src/org/netbeans/modules/jackpot30/backend/language/api/JavacCreatorImpl.java @@ -0,0 +1,116 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2012 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2012 Sun Microsystems, Inc. + */ +package org.netbeans.modules.jackpot30.backend.language.api; + +import com.sun.tools.javac.api.JavacTaskImpl; +import com.sun.tools.javac.api.JavacTool; +import com.sun.tools.javac.util.Context; +import com.sun.tools.javadoc.JavadocClassFinder; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.Writer; +import java.util.ArrayList; +import java.util.List; +import javax.tools.DiagnosticListener; +import javax.tools.JavaFileManager; +import javax.tools.JavaFileObject; +import org.netbeans.lib.nbjavac.services.NBAttr; +import org.netbeans.lib.nbjavac.services.NBClassReader; +import org.netbeans.lib.nbjavac.services.NBClassWriter; +import org.netbeans.lib.nbjavac.services.NBJavacTrees; +import org.netbeans.lib.nbjavac.services.NBJavadocEnter; +import org.netbeans.lib.nbjavac.services.NBJavadocMemberEnter; +import org.netbeans.lib.nbjavac.services.NBMessager; +import org.netbeans.lib.nbjavac.services.NBParserFactory; +import org.netbeans.lib.nbjavac.services.NBTreeMaker; +import org.netbeans.modules.jackpot30.resolve.api.JavacCreator; +import org.openide.util.lookup.ServiceProvider; + +/** + * + * @author lahvac + */ +@ServiceProvider(service = JavacCreator.class) +public class JavacCreatorImpl extends JavacCreator { + + @Override + protected JavacTaskImpl doCreate(Writer out, JavaFileManager fileManager, DiagnosticListener<? super JavaFileObject> diagnosticListener, Iterable<String> options, Iterable<String> classes, Iterable<? extends JavaFileObject> compilationUnits) { + List<String> realOptions = new ArrayList<String>(); + for (String option : options) { + realOptions.add(option); + } + realOptions.add("-Xjcov"); //NOI18N, Make the compiler store end positions + realOptions.add("-XDallowStringFolding=false"); //NOI18N + realOptions.add("-XDshouldStopPolicy=GENERATE"); // NOI18N, parsing should not stop in phase where an error is found + realOptions.add("-XDsuppressAbortOnBadClassFile=true"); + realOptions.add("-XDkeepComments=true"); //NOI18N + Context context = new Context(); + //need to preregister the Messages here, because the getTask below requires Log instance: + NBMessager.preRegister(context, null, DEV_NULL, DEV_NULL, DEV_NULL); + JavacTaskImpl task = (JavacTaskImpl) JavacTool.create().getTask(out, fileManager, diagnosticListener, realOptions, classes, compilationUnits, context); + NBClassReader.preRegister(context); + NBAttr.preRegister(context); + NBClassWriter.preRegister(context); + NBParserFactory.preRegister(context); + NBTreeMaker.preRegister(context); + NBJavacTrees.preRegister(context); + NBJavadocEnter.preRegister(context); + NBJavadocMemberEnter.preRegister(context); + JavadocClassFinder.preRegister(context); + + return task; + } + + private static final PrintWriter DEV_NULL = new PrintWriter(new NullWriter(), false); + + private static class NullWriter extends Writer { + + public void write(char[] cbuf, int off, int len) throws IOException { + } + + public void flush() throws IOException { + } + + public void close() throws IOException { + } + } +} http://git-wip-us.apache.org/repos/asf/incubator-netbeans-jackpot30/blob/9ed0a377/language/server/web/language.web.api/src/org/netbeans/modules/jackpot30/backend/language/api/UI.java ---------------------------------------------------------------------- diff --git a/language/server/web/language.web.api/src/org/netbeans/modules/jackpot30/backend/language/api/UI.java b/language/server/web/language.web.api/src/org/netbeans/modules/jackpot30/backend/language/api/UI.java new file mode 100644 index 0000000..9ab5235 --- /dev/null +++ b/language/server/web/language.web.api/src/org/netbeans/modules/jackpot30/backend/language/api/UI.java @@ -0,0 +1,271 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2009-2010 Sun Microsystems, Inc. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2009-2010 Sun Microsystems, Inc. + */ + +package org.netbeans.modules.jackpot30.backend.language.api; + +import freemarker.cache.TemplateLoader; +import freemarker.template.Configuration; +import freemarker.template.Template; +import freemarker.template.TemplateException; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.StringWriter; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import javax.ws.rs.DefaultValue; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriInfo; +import org.codeviation.pojson.Pojson; +import org.netbeans.modules.jackpot30.backend.base.WebUtilities; +import static org.netbeans.modules.jackpot30.backend.base.WebUtilities.escapeForQuery; + +/** + * + * @author lahvac + */ +@Path("/index/languageui") +public class UI { + + @GET + @Path("/search") + @Produces("text/html") + public String search(@Context UriInfo uriInfo, @QueryParam("path") String path, @QueryParam("pattern") String pattern, @QueryParam("validate") @DefaultValue("false") boolean validate) throws URISyntaxException, IOException, TemplateException { + String urlBase = uriInfo.getBaseUri().toString(); + Map<String, Object> configurationData = new HashMap<String, Object>(); + + configurationData.put("paths", list(urlBase)); + configurationData.put("selectedPath", path); + configurationData.put("pattern", pattern); + configurationData.put("patternEscaped", escapeForQuery(pattern)); + + if (pattern != null && path != null) { + URI u = new URI(urlBase + "index/language/search?path=" + escapeForQuery(path) + "&pattern=" + escapeForQuery(pattern) + "&validate=" + validate); + List<Map<String, Object>> results = new LinkedList<Map<String, Object>>(); + long queryTime = System.currentTimeMillis(); + List<String> candidates = new ArrayList<String>(WebUtilities.requestStringArrayResponse(u)); + + queryTime = System.currentTimeMillis() - queryTime; + + Collections.sort(candidates); + + for (String c : candidates) { + Map<String, Object> found = new HashMap<String, Object>(3); + + found.put("relativePath", c); + + results.add(found); + } + + configurationData.put("results", results); + + Map<String, Object> statistics = new HashMap<String, Object>(); + + statistics.put("files", candidates.size()); + statistics.put("queryTime", queryTime); + + configurationData.put("statistics", statistics); + } + + return processTemplate("/org/netbeans/modules/jackpot30/backend/language/api/ui-search.html", configurationData); + } + + @GET + @Path("/show") + @Produces("text/html") + public Response show(@Context UriInfo uriInfo, @QueryParam("path") String path, @QueryParam("relative") String relativePath, @QueryParam("pattern") String pattern) throws URISyntaxException, IOException, TemplateException { + String urlBase = uriInfo.getBaseUri().toString(); + URI spansURL = new URI(urlBase + "index/language/searchSpans?path=" + escapeForQuery(path) + "&relativePath=" + escapeForQuery(relativePath) + "&pattern=" + escapeForQuery(pattern)); + return Response.temporaryRedirect(new URI("/index/ui/show?path=" + escapeForQuery(path) + "&relative=" + escapeForQuery(relativePath) + "&highlight=" + escapeForQuery(Pojson.save(parseSpans2(WebUtilities.requestStringResponse(spansURL)))))).build(); + } + + @GET + @Path("/snippet") + @Produces("text/html") + public String snippet(@Context UriInfo uriInfo, @QueryParam("path") String path, @QueryParam("relative") String relativePath, @QueryParam("pattern") String pattern) throws URISyntaxException, IOException, TemplateException { + String urlBase = uriInfo.getBaseUri().toString(); + List<Map<String, String>> snippets = new LinkedList<Map<String, String>>(); + + URI codeURL = new URI(urlBase + "index/source/cat?path=" + escapeForQuery(path) + "&relative=" + escapeForQuery(relativePath)); + String code = WebUtilities.requestStringResponse(codeURL); + URI spansURL = new URI(urlBase + "index/language/searchSpans?path=" + escapeForQuery(path) + "&relativePath=" + escapeForQuery(relativePath) + "&pattern=" + escapeForQuery(pattern)); + + for (int[] span : parseSpans(WebUtilities.requestStringResponse(spansURL))) { + snippets.add(prepareSnippet(code, span)); + } + + return processTemplate("/org/netbeans/modules/jackpot30/backend/language/api/ui-snippet.html", Collections.<String, Object>singletonMap("snippets", snippets)); + } + + private static List<Map<String, String>> list(String urlBase) throws URISyntaxException { + List<Map<String, String>> result = new LinkedList<Map<String, String>>(); + + for (String enc : WebUtilities.requestStringArrayResponse(new URI(urlBase + "index/list"))) { + Map<String, String> rootDesc = new HashMap<String, String>(); + String[] col = enc.split(":", 2); + + rootDesc.put("segment", col[0]); + rootDesc.put("displayName", col[1]); + result.add(rootDesc); + } + + return result; + } + + private static Iterable<int[]> parseSpans(String from) { + if (from.isEmpty()) { + return Collections.emptyList(); + } + String[] split = from.split(":"); + List<int[]> result = new LinkedList<int[]>(); + + for (int i = 0; i < split.length; i += 2) { + result.add(new int[] { + Integer.parseInt(split[i + 0].trim()), + Integer.parseInt(split[i + 1].trim()) + }); + } + + return result; + } + + private static Iterable<Long> parseSpans2(String from) { + if (from.isEmpty()) { + return Collections.emptyList(); + } + String[] split = from.split(":"); + List<Long> result = new LinkedList<Long>(); + + for (String s : split) { + result.add(Long.parseLong(s.trim())); + } + + return result; + } + + private static final int DESIRED_CONTEXT = 2; + + private static Map<String, String> prepareSnippet(String code, int[] span) { + int grandStart = span[0]; + int firstLineStart = grandStart = lineStart(code, grandStart); + + while (grandStart > 0 && contextLength(code.substring(grandStart, firstLineStart)) < DESIRED_CONTEXT) + grandStart = lineStart(code, grandStart - 1); + + int grandEnd = span[1]; + int firstLineEnd = grandEnd = lineEnd(code, grandEnd); + + while (grandEnd < code.length() - 1 && contextLength(code.substring(firstLineEnd, grandEnd)) < DESIRED_CONTEXT) + grandEnd = lineEnd(code, grandEnd + 1); + + Map<String, String> result = new HashMap<String, String>(); + + result.put("prefix", WebUtilities.escapeForHTMLElement(code.substring(grandStart, span[0]))); + result.put("occurrence", WebUtilities.escapeForHTMLElement(code.substring(span[0], span[1]))); + result.put("suffix", WebUtilities.escapeForHTMLElement(code.substring(span[1], grandEnd))); + + return result; + } + + private static int lineStart(String code, int o) { + while (o > 0 && code.charAt(o) != '\n') { + o--; + } + + return o; + } + + private static int lineEnd(String code, int o) { + while (o < code.length() - 1 && code.charAt(o) != '\n') { + o++; + } + + return o; + } + + private static int contextLength(String in) { + return in.replaceAll("\n[ \t]*\n", "\n").trim().split("\n").length; + } + + private static String processTemplate(String template, Map<String, Object> configurationData) throws TemplateException, IOException { + Configuration conf = new Configuration(); + + conf.setTemplateLoader(new TemplateLoaderImpl()); + + Template templ = conf.getTemplate(template); + StringWriter out = new StringWriter(); + + templ.process(configurationData, out); + + return out.toString(); + } + + private static final class TemplateLoaderImpl implements TemplateLoader { + + public Object findTemplateSource(String name) throws IOException { + return TemplateLoaderImpl.class.getResourceAsStream("/" + name); + } + + public long getLastModified(Object templateSource) { + return 0L; + } + + public Reader getReader(Object templateSource, String encoding) throws IOException { + InputStream in = (InputStream) templateSource; + + return new InputStreamReader(in); + } + + public void closeTemplateSource(Object templateSource) throws IOException { + } + } + +} http://git-wip-us.apache.org/repos/asf/incubator-netbeans-jackpot30/blob/9ed0a377/language/server/web/language.web.api/src/org/netbeans/modules/jackpot30/backend/language/api/ui-search.html ---------------------------------------------------------------------- diff --git a/language/server/web/language.web.api/src/org/netbeans/modules/jackpot30/backend/language/api/ui-search.html b/language/server/web/language.web.api/src/org/netbeans/modules/jackpot30/backend/language/api/ui-search.html new file mode 100644 index 0000000..3e308e3 --- /dev/null +++ b/language/server/web/language.web.api/src/org/netbeans/modules/jackpot30/backend/language/api/ui-search.html @@ -0,0 +1,127 @@ +<!-- +DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +Copyright 2009-2017 Oracle and/or its affiliates. All rights reserved. + +Oracle and Java are registered trademarks of Oracle and/or its affiliates. +Other names may be trademarks of their respective owners. + +The contents of this file are subject to the terms of either the GNU +General Public License Version 2 only ("GPL") or the Common +Development and Distribution License("CDDL") (collectively, the +"License"). You may not use this file except in compliance with the +License. You can obtain a copy of the License at +http://www.netbeans.org/cddl-gplv2.html +or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the +specific language governing permissions and limitations under the +License. When distributing the software, include this License Header +Notice in each file and include the License file at +nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this +particular file as subject to the "Classpath" exception as provided +by Oracle in the GPL Version 2 section of the License file that +accompanied this code. If applicable, add the following below the +License Header, with the fields enclosed by brackets [] replaced by +your own identifying information: +"Portions Copyrighted [year] [name of copyright owner]" + +Contributor(s): + +The Original Software is NetBeans. The Initial Developer of the Original +Software is Sun Microsystems, Inc. Portions Copyright 2009-2010 Sun +Microsystems, Inc. All Rights Reserved. + +If you wish your version of this file to be governed by only the CDDL +or only the GPL Version 2, indicate your decision by adding +"[Contributor] elects to include this software in this distribution +under the [CDDL or GPL Version 2] license." If you do not indicate a +single choice of license, a recipient has the option to distribute +your version of this file under either the CDDL, the GPL Version 2 or +to extend the choice of license to its licensees as provided above. +However, if you add GPL Version 2 code and therefore, elected the GPL +Version 2 license, then the option applies only if the new code is +made subject to such option by the copyright holder. +--> +<html> +<head> + <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> +<#if results??> + <script type="text/javascript"> + //XXX: duplicate: + function paramValue(param) { + var $params = window.location.search.substring(1).split("&"); + + for (var i = 0; i < $params.length; i++) { + if ($params[i].indexOf(param + "=") !== (-1)) { + return unescape($params[i].substring((param + "=").length)); + } + } + } + $(document).ready(function() { + if (paramValue("validate") == "true") { + $('#validate').attr("checked", "true"); + } + $('#list').find('dd').hide().end().find('dt').click(function() { + current_dd=$(this).next(); + //XXX: will do the AJAX call for both show and hide! + $.get("snippet?path=${selectedPath}&relative=" + current_dd.attr("id") + "&pattern=${patternEscaped}",function(data) { + current_dd.html(data).slideToggle(); + }) + }); + }); + </script> +</#if> + <style type="text/css"> + .occurrence {BACKGROUND: #DDDD00;} + </style> +</head> +<body> +<form method="get"> + +<label for="path">Project:</label> +<select size="1" name="path">"); + <#list paths as path> + <option <#if selectedPath?? && path.segment == selectedPath>selected</#if> value="${path.segment}"> + ${path.displayName} + </option> + </#list> +</select> +<br> +<label for="pattern">Pattern:</label><br> +<textarea rows="10" cols="40" name="pattern"> +<#if pattern??> +${pattern} +</#if> +</textarea><br> +<input type="checkbox" name="validate" value="true" id="validate">Validate (slower)<br> +<input type="submit" name="Find Candidates"/> +</form> + +<div class="examples"> +<#if examples??> + Examples: + <dl id="examples-list"> + <#list examples as example> + <dt>${example.displayName}</dt> + <dd><pre>${example.pattern}</pre> + </dd> + </#list> + </dl> +</#if> +</div> + +<#if results??> + Found candidates for pattern: ${pattern} + <dl id="list"> + <#list results as result> + <dt>${result.relativePath}<a href="/index/languageui/show?path=${selectedPath}&relative=${result.relativePath}&pattern=${patternEscaped}">show</a></dt> + <dd id="${result.relativePath}"> + </dd> + </#list> + </dl> +</#if> + +<#if statistics??> + Query time: ${statistics.queryTime}ms, matching files: ${statistics.files}. +</#if> +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-netbeans-jackpot30/blob/9ed0a377/language/server/web/language.web.api/src/org/netbeans/modules/jackpot30/backend/language/api/ui-snippet.html ---------------------------------------------------------------------- diff --git a/language/server/web/language.web.api/src/org/netbeans/modules/jackpot30/backend/language/api/ui-snippet.html b/language/server/web/language.web.api/src/org/netbeans/modules/jackpot30/backend/language/api/ui-snippet.html new file mode 100644 index 0000000..1ece00f --- /dev/null +++ b/language/server/web/language.web.api/src/org/netbeans/modules/jackpot30/backend/language/api/ui-snippet.html @@ -0,0 +1,51 @@ +<!-- +DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +Copyright 2009-2017 Oracle and/or its affiliates. All rights reserved. + +Oracle and Java are registered trademarks of Oracle and/or its affiliates. +Other names may be trademarks of their respective owners. + +The contents of this file are subject to the terms of either the GNU +General Public License Version 2 only ("GPL") or the Common +Development and Distribution License("CDDL") (collectively, the +"License"). You may not use this file except in compliance with the +License. You can obtain a copy of the License at +http://www.netbeans.org/cddl-gplv2.html +or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the +specific language governing permissions and limitations under the +License. When distributing the software, include this License Header +Notice in each file and include the License file at +nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this +particular file as subject to the "Classpath" exception as provided +by Oracle in the GPL Version 2 section of the License file that +accompanied this code. If applicable, add the following below the +License Header, with the fields enclosed by brackets [] replaced by +your own identifying information: +"Portions Copyrighted [year] [name of copyright owner]" + +Contributor(s): + +The Original Software is NetBeans. The Initial Developer of the Original +Software is Sun Microsystems, Inc. Portions Copyright 2009-2010 Sun +Microsystems, Inc. All Rights Reserved. + +If you wish your version of this file to be governed by only the CDDL +or only the GPL Version 2, indicate your decision by adding +"[Contributor] elects to include this software in this distribution +under the [CDDL or GPL Version 2] license." If you do not indicate a +single choice of license, a recipient has the option to distribute +your version of this file under either the CDDL, the GPL Version 2 or +to extend the choice of license to its licensees as provided above. +However, if you add GPL Version 2 code and therefore, elected the GPL +Version 2 license, then the option applies only if the new code is +made subject to such option by the copyright holder. +--> + +<#if snippets??> + <#list snippets as snippet> + <pre>${snippet.prefix}<span class="occurrence">${snippet.occurrence}</span>${snippet.suffix}</pre><br> + </#list> +<#else> + No occurrences. +</#if> http://git-wip-us.apache.org/repos/asf/incubator-netbeans-jackpot30/blob/9ed0a377/language/server/web/language.web.api/src/org/netbeans/modules/java/source/parsing/HackAccessor.java ---------------------------------------------------------------------- diff --git a/language/server/web/language.web.api/src/org/netbeans/modules/java/source/parsing/HackAccessor.java b/language/server/web/language.web.api/src/org/netbeans/modules/java/source/parsing/HackAccessor.java new file mode 100644 index 0000000..a1f10f7 --- /dev/null +++ b/language/server/web/language.web.api/src/org/netbeans/modules/java/source/parsing/HackAccessor.java @@ -0,0 +1,54 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2009-2010 Sun Microsystems, Inc. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2009-2010 Sun Microsystems, Inc. + */ + +package org.netbeans.modules.java.source.parsing; + +import org.netbeans.api.java.source.ClasspathInfo; + +/** + * + * @author lahvac + */ +public class HackAccessor { + + public static CompilationInfoImpl createCII(ClasspathInfo cpInfo) { + return new CompilationInfoImpl(cpInfo); + } + +} http://git-wip-us.apache.org/repos/asf/incubator-netbeans-jackpot30/blob/9ed0a377/lib/download.xml ---------------------------------------------------------------------- diff --git a/lib/download.xml b/lib/download.xml new file mode 100644 index 0000000..ee1d5d9 --- /dev/null +++ b/lib/download.xml @@ -0,0 +1,137 @@ +<!-- +DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +Copyright 2009-2017 Oracle and/or its affiliates. All rights reserved. + +Oracle and Java are registered trademarks of Oracle and/or its affiliates. +Other names may be trademarks of their respective owners. + +The contents of this file are subject to the terms of either the GNU +General Public License Version 2 only ("GPL") or the Common +Development and Distribution License("CDDL") (collectively, the +"License"). You may not use this file except in compliance with the +License. You can obtain a copy of the License at +http://www.netbeans.org/cddl-gplv2.html +or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the +specific language governing permissions and limitations under the +License. When distributing the software, include this License Header +Notice in each file and include the License file at +nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this +particular file as subject to the "Classpath" exception as provided +by Oracle in the GPL Version 2 section of the License file that +accompanied this code. If applicable, add the following below the +License Header, with the fields enclosed by brackets [] replaced by +your own identifying information: +"Portions Copyrighted [year] [name of copyright owner]" + +Contributor(s): + +The Original Software is NetBeans. The Initial Developer of the Original +Software is Sun Microsystems, Inc. Portions Copyright 2009-2010 Sun +Microsystems, Inc. All Rights Reserved. + +If you wish your version of this file to be governed by only the CDDL +or only the GPL Version 2, indicate your decision by adding +"[Contributor] elects to include this software in this distribution +under the [CDDL or GPL Version 2] license." If you do not indicate a +single choice of license, a recipient has the option to distribute +your version of this file under either the CDDL, the GPL Version 2 or +to extend the choice of license to its licensees as provided above. +However, if you add GPL Version 2 code and therefore, elected the GPL +Version 2 license, then the option applies only if the new code is +made subject to such option by the copyright holder. +--> +<project name="download" default="download"> + <target name="download" depends="copy-from-platform"> + <property name="imported.basedir" value="${basedir}"/> + + <macrodef name="download"> + <attribute name="url"/> + <attribute name="target"/> + <sequential> + <antcall target="-download" inheritAll="false"> + <param name="url" value="@{url}" /> + <param name="target" value="@{target}" /> + <param name="imported.basedir" value="${imported.basedir}" /> + </antcall> + </sequential> + </macrodef> + <download url="http://central.maven.org/maven2/com/sun/jersey/jersey-client/1.0.1/jersey-client-1.0.1.jar" target="jersey-1.1/jersey-client-1.0.1.jar"/> + <download url="http://central.maven.org/maven2/com/sun/jersey/jersey-client/1.0.1/jersey-client-1.0.1-javadoc.jar" target="jersey-1.1/jersey-client-1.0.1-javadoc.jar"/> + <download url="http://central.maven.org/maven2/com/sun/jersey/jersey-client/1.0.1/jersey-client-1.0.1-sources.jar" target="jersey-1.1/jersey-client-1.0.1-sources.jar"/> + <download url="http://central.maven.org/maven2/com/sun/jersey/jersey-core/1.0.1/jersey-core-1.0.1.jar" target="jersey-1.1/jersey-core-1.0.1.jar"/> + <download url="http://central.maven.org/maven2/com/sun/jersey/jersey-core/1.0.1/jersey-core-1.0.1-javadoc.jar" target="jersey-1.1/jersey-core-1.0.1-javadoc.jar"/> + <download url="http://central.maven.org/maven2/com/sun/jersey/jersey-core/1.0.1/jersey-core-1.0.1-sources.jar" target="jersey-1.1/jersey-core-1.0.1-sources.jar"/> + <download url="http://central.maven.org/maven2/com/sun/jersey/jersey-server/1.0.1/jersey-server-1.0.1.jar" target="jersey-1.1/jersey-server-1.0.1.jar"/> + <download url="http://central.maven.org/maven2/com/sun/jersey/jersey-server/1.0.1/jersey-server-1.0.1-javadoc.jar" target="jersey-1.1/jersey-server-1.0.1-javadoc.jar"/> + <download url="http://central.maven.org/maven2/com/sun/jersey/jersey-server/1.0.1/jersey-server-1.0.1-sources.jar" target="jersey-1.1/jersey-server-1.0.1-sources.jar"/> + <download url="http://central.maven.org/maven2/com/sun/grizzly/grizzly-servlet-webserver/1.8.6.3/grizzly-servlet-webserver-1.8.6.3.jar" target="jersey-1.1/grizzly-servlet-webserver-1.8.6.3.jar"/> + <download url="http://central.maven.org/maven2/com/sun/grizzly/grizzly-servlet-webserver/1.9.14/grizzly-servlet-webserver-1.9.14-javadoc.jar" target="jersey-1.1/grizzly-servlet-webserver-1.9.14-javadoc.jar"/> + <download url="http://central.maven.org/maven2/com/sun/grizzly/grizzly-servlet-webserver/1.9.14/grizzly-servlet-webserver-1.9.14-sources.jar" target="jersey-1.1/grizzly-servlet-webserver-1.9.14-sources.jar"/> + <download url="http://central.maven.org/maven2/javax/ws/rs/jsr311-api/1.0/jsr311-api-1.0.jar" target="jersey-1.1/jsr311-api-1.0.jar"/> + <download url="http://central.maven.org/maven2/javax/ws/rs/jsr311-api/1.0/jsr311-api-1.0-javadoc.jar" target="jersey-1.1/jsr311-api-1.0-javadoc.jar"/> + <download url="http://central.maven.org/maven2/javax/ws/rs/jsr311-api/1.0/jsr311-api-1.0-sources.jar" target="jersey-1.1/jsr311-api-1.0-sources.jar"/> + <download url="http://repo2.maven.org/maven2/asm/asm-all/3.1/asm-all-3.1.jar" target="jersey-1.1/asm-all-3.1.jar"/> + <download url="http://repo2.maven.org/maven2/asm/asm-all/3.1/asm-all-3.1-sources.jar" target="jersey-1.1/asm-all-3.1-sources.jar"/> + + <download url="http://repo1.maven.org/maven2/org/apache/lucene/lucene-core/3.5.0/lucene-core-3.5.0.jar" target="lucene-3.5.0/lucene-core-3.5.0.jar" /> + <download url="http://repo1.maven.org/maven2/org/apache/lucene/lucene-core/3.5.0/lucene-core-3.5.0-javadoc.jar" target="lucene-3.5.0/lucene-core-3.5.0-javadoc.jar" /> + <download url="http://repo1.maven.org/maven2/org/apache/lucene/lucene-core/3.5.0/lucene-core-3.5.0-sources.jar" target="lucene-3.5.0/lucene-core-3.5.0-sources.jar" /> + + <download url="http://repo1.maven.org/maven2/junit/junit/4.5/junit-4.5.jar" target="junit_4/junit-4.5.jar" /> +<!-- <download url="http://switch.dl.sourceforge.net/project/junit/junit/4.5/junit4.5.zip" target="junit_4/junit-4.5-api.zip" />--> + <download url="http://repo1.maven.org/maven2/junit/junit/4.5/junit-4.5-sources.jar" target="junit_4/junit-4.5-src.jar" /> + + <download url="http://repo1.maven.org/maven2/junit/junit/3.8.2/junit-3.8.2.jar" target="junit/junit-3.8.2.jar" /> + <download url="http://repo1.maven.org/maven2/junit/junit/3.8.2/junit-3.8.2-javadoc.jar" target="junit/junit-3.8.2-javadoc.jar" /> + <download url="http://repo1.maven.org/maven2/junit/junit/3.8.2/junit-3.8.2-sources.jar" target="junit/junit-3.8.2-sources.jar" /> + + <download url="http://lahoda.info/hudson/userContent/org-netbeans-modules-java-j2seproject-copylibstask.jar" target="CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar" /> + + <download url="http://central.maven.org/maven2/org/freemarker/freemarker/2.3.16/freemarker-2.3.16.jar" target="freemarker/freemarker-2.3.16.jar" /> + + <download url="http://central.maven.org/maven2/net/sf/jopt-simple/jopt-simple/3.2/jopt-simple-3.2.jar" target="jopt-simple/jopt-simple-3.2.jar" /> + <download url="http://central.maven.org/maven2/net/sf/jopt-simple/jopt-simple/3.2/jopt-simple-3.2-sources.jar" target="jopt-simple/jopt-simple-3.2-sources.jar" /> + <download url="http://central.maven.org/maven2/net/sf/jopt-simple/jopt-simple/3.2/jopt-simple-3.2-javadoc.jar" target="jopt-simple/jopt-simple-3.2-javadoc.jar" /> + </target> + + <target name="-download-check-exists"> + <available property="file.exists" file="${imported.basedir}/lib/${target}"/> + </target> + + <target name="-download" depends="-download-check-exists" unless="file.exists"> + <dirname property="dir" file="${imported.basedir}/${target}" /> + <mkdir dir="${dir}" /> + <get src="${url}" dest="${imported.basedir}/${target}" usetimestamp="true"/> + </target> + + <target name="-prepare-imported-basedir-property"> + <dirname property="imported.basedir" file="${ant.file.download}"/> + </target> + <target name="-post-init" depends="-prepare-imported-basedir-property,download"/> + + <target name="copy-from-platform"> + <fail unless="nbplatform.active.dir" /> + <copy file="${nbplatform.active.dir}/java/modules/org-netbeans-modules-java-source-base.jar" todir="." /> + <copy file="${nbplatform.active.dir}/java/modules/org-netbeans-modules-java-hints.jar" todir="." /> + <copy file="${nbplatform.active.dir}/platform/core/org-openide-filesystems.jar" todir="." /> + <copy file="${nbplatform.active.dir}/platform/lib/org-openide-util.jar" todir="." /> + <copy file="${nbplatform.active.dir}/platform/lib/org-openide-util-lookup.jar" todir="." /> + <copy file="${nbplatform.active.dir}/ide/modules/org-netbeans-spi-editor-hints.jar" todir="." /> + <copy file="${nbplatform.active.dir}/ide/modules/org-netbeans-api-java-classpath.jar" todir="." /> + <copy file="${nbplatform.active.dir}/java/modules/ext/nb-javac-api.jar" todir="javac" /> + <copy file="${nbplatform.active.dir}/java/modules/ext/nb-javac-impl.jar" todir="javac" /> + <copy file="${nbplatform.active.dir}/ide/modules/org-netbeans-modules-jumpto.jar" todir="." /> + <copy file="${nbplatform.active.dir}/platform/modules/org-netbeans-modules-masterfs.jar" todir="." /> + <copy file="${nbplatform.active.dir}/ide/modules/org-netbeans-modules-parsing-lucene.jar" todir="." /> + <copy file="${nbplatform.active.dir}/ide/modules/org-netbeans-modules-parsing-api.jar" todir="." /> + <copy file="${nbplatform.active.dir}/ide/modules/org-netbeans-modules-projectapi.jar" todir="." /> + <copy file="${nbplatform.active.dir}/java/modules/org-netbeans-modules-java-project.jar" todir="." /> + <copy file="${nbplatform.active.dir}/ide/modules/org-netbeans-modules-lexer.jar" todir="." /> + <copy file="${nbplatform.active.dir}/java/modules/org-netbeans-modules-java-lexer.jar" todir="." /> + <copy file="${nbplatform.active.dir}/ide/modules/org-netbeans-modules-editor-util.jar" todir="." /> + <copy file="${nbplatform.active.dir}/java/modules/org-netbeans-spi-java-hints.jar" todir="." /> + <copy file="${nbplatform.active.dir}/java/modules/org-netbeans-lib-nbjavac.jar" todir="." /> + <copy file="${nbplatform.active.dir}/ide/modules/org-netbeans-modules-xml-lexer.jar" todir="." /> + </target> +</project> http://git-wip-us.apache.org/repos/asf/incubator-netbeans-jackpot30/blob/9ed0a377/lib/nblibraries.properties ---------------------------------------------------------------------- diff --git a/lib/nblibraries.properties b/lib/nblibraries.properties new file mode 100644 index 0000000..b298103 --- /dev/null +++ b/lib/nblibraries.properties @@ -0,0 +1,93 @@ +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +# Copyright 2009-2017 Oracle and/or its affiliates. All rights reserved. +# +# Oracle and Java are registered trademarks of Oracle and/or its affiliates. +# Other names may be trademarks of their respective owners. +# +# The contents of this file are subject to the terms of either the GNU +# General Public License Version 2 only ("GPL") or the Common +# Development and Distribution License("CDDL") (collectively, the +# "License"). You may not use this file except in compliance with the +# License. You can obtain a copy of the License at +# http://www.netbeans.org/cddl-gplv2.html +# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the +# specific language governing permissions and limitations under the +# License. When distributing the software, include this License Header +# Notice in each file and include the License file at +# nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the GPL Version 2 section of the License file that +# accompanied this code. If applicable, add the following below the +# License Header, with the fields enclosed by brackets [] replaced by +# your own identifying information: +# "Portions Copyrighted [year] [name of copyright owner]" +# +# Contributor(s): +# +# The Original Software is NetBeans. The Initial Developer of the Original +# Software is Sun Microsystems, Inc. Portions Copyright 2009-2010 Sun +# Microsystems, Inc. All Rights Reserved. +# +# If you wish your version of this file to be governed by only the CDDL +# or only the GPL Version 2, indicate your decision by adding +# "[Contributor] elects to include this software in this distribution +# under the [CDDL or GPL Version 2] license." If you do not indicate a +# single choice of license, a recipient has the option to distribute +# your version of this file under either the CDDL, the GPL Version 2 or +# to extend the choice of license to its licensees as provided above. +# However, if you add GPL Version 2 code and therefore, elected the GPL +# Version 2 license, then the option applies only if the new code is +# made subject to such option by the copyright holder. +libs.CopyLibs.classpath=\ + ${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar +libs.CopyLibs.displayName=CopyLibs Task +libs.CopyLibs.prop-version=2.0 +libs.jopt-simple.classpath=\ + ${base}/jopt-simple/jopt-simple-3.2.jar +libs.jopt-simple.javadoc=\ + ${base}/jopt-simple/jopt-simple-3.2-javadoc.jar!// +libs.jopt-simple.src=\ + ${base}/jopt-simple/jopt-simple-3.2-sources.jar +libs.junit.classpath=\ + ${base}/junit/junit-3.8.2.jar +libs.junit.javadoc=\ + ${base}/junit/junit-3.8.2-api.zip +libs.junit_4.classpath=\ + ${base}/junit_4/junit-4.5.jar +libs.junit_4.javadoc=\ + ${base}/junit_4/junit-4.5-api.zip +libs.junit_4.src=\ + ${base}/junit_4/junit-4.5-src.jar +libs.jersey.classpath=\ + ${base}/jersey-1.1/grizzly-servlet-webserver-1.8.6.3.jar:\ + ${base}/jersey-1.1/jersey-client-1.0.1.jar:\ + ${base}/jersey-1.1/jersey-core-1.0.1.jar:\ + ${base}/jersey-1.1/jersey-server-1.0.1.jar:\ + ${base}/jersey-1.1/asm-all-3.1.jar:\ + ${base}/jersey-1.1/jsr311-api-1.0.jar +libs.jersey.src=\ + ${base}/jersey-1.1/jersey-client-1.0.1-sources.jar:\ + ${base}/jersey-1.1/jersey-core-1.0.1-sources.jar:\ + ${base}/jersey-1.1/jersey-server-1.0.1-sources.jar:\ + ${base}/jersey-1.1/asm-all-3.1-sources.jar:\ + ${base}/jersey-1.1/jsr311-api-1.0-sources.jar +libs.lucene.classpath=\ + ${base}/lucene-3.5.0/lucene-core-3.5.0.jar +libs.jersey.javadoc=\ + ${base}/jersey-1.1/jersey-client-1.0.1-javadoc.jar!//:\ + ${base}/jersey-1.1/jersey-core-1.0.1-javadoc.jar!//:\ + ${base}/jersey-1.1/jersey-server-1.0.1-javadoc.jar!//:\ + ${base}/jersey-1.1/jsr311-api-1.0-javadoc.jar!// +libs.lucene.javadoc=\ + ${base}/lucene-3.5.0/lucene-core-3.5.0-javadoc.jar!// +libs.lucene.src=\ + ${base}/lucene-3.5.0/lucene-core-3.5.0-sources.jar +libs.javac.classpath=\ + ${base}/javac/nb-javac-api.jar:\ + ${base}/javac/nb-javac-impl.jar +libs.freemarker.classpath=\ + ${base}/freemarker/freemarker-2.3.16.jar +libs.freemarker.src=\ + ${base}/freemarker/freemarker-src.zip + http://git-wip-us.apache.org/repos/asf/incubator-netbeans-jackpot30/blob/9ed0a377/nbproject/project.xml ---------------------------------------------------------------------- diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100644 index 0000000..eb1d7ce --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +Copyright 2009-2017 Oracle and/or its affiliates. All rights reserved. + +Oracle and Java are registered trademarks of Oracle and/or its affiliates. +Other names may be trademarks of their respective owners. + +The contents of this file are subject to the terms of either the GNU +General Public License Version 2 only ("GPL") or the Common +Development and Distribution License("CDDL") (collectively, the +"License"). You may not use this file except in compliance with the +License. You can obtain a copy of the License at +http://www.netbeans.org/cddl-gplv2.html +or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the +specific language governing permissions and limitations under the +License. When distributing the software, include this License Header +Notice in each file and include the License file at +nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this +particular file as subject to the "Classpath" exception as provided +by Oracle in the GPL Version 2 section of the License file that +accompanied this code. If applicable, add the following below the +License Header, with the fields enclosed by brackets [] replaced by +your own identifying information: +"Portions Copyrighted [year] [name of copyright owner]" + +Contributor(s): + +The Original Software is NetBeans. The Initial Developer of the Original +Software is Sun Microsystems, Inc. Portions Copyright 2009-2010 Sun +Microsystems, Inc. All Rights Reserved. + +If you wish your version of this file to be governed by only the CDDL +or only the GPL Version 2, indicate your decision by adding +"[Contributor] elects to include this software in this distribution +under the [CDDL or GPL Version 2] license." If you do not indicate a +single choice of license, a recipient has the option to distribute +your version of this file under either the CDDL, the GPL Version 2 or +to extend the choice of license to its licensees as provided above. +However, if you add GPL Version 2 code and therefore, elected the GPL +Version 2 license, then the option applies only if the new code is +made subject to such option by the copyright holder. +--> +<project xmlns="http://www.netbeans.org/ns/project/1" xmlns:ns1="null" xmlns:ns2="null"> + <type>org.netbeans.modules.ant.freeform</type> + <configuration> + <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1"> + <!-- Do not use Project Properties customizer when editing this file manually. --> + <name>jackpot30</name> + <properties/> + <ide-actions/> + <view> + <items> + <source-file> + <location>build.xml</location> + </source-file> + </items> + <context-menu/> + </view> + <subprojects> + <project>cmdline</project> + <project>duplicates/ide</project> + <project>language/ide</project> + <project>remoting/common</project> + <project>remoting/ide</project> + <project>remoting/server/hudson</project> + <project>remoting/server/indexer</project> + <project>remoting/server/web/web.main</project> + </subprojects> + </general-data> + </configuration> +</project>
