Permalink
Browse files

transfer

  • Loading branch information...
elucash committed May 21, 2017
1 parent 44e6d99 commit 7b903087c8024417db2fa218efa29db0660b9f18
Showing with 11,114 additions and 0 deletions.
  1. +21 −0 .buckconfig
  2. +3 −0 .buckjavaargs
  3. +49 −0 .classpath
  4. +5 −0 .factorypath
  5. +6 −0 .gitignore
  6. +227 −0 .prj.lib.js
  7. +17 −0 .project
  8. +4 −0 .settings/org.eclipse.core.resources.prefs
  9. +4 −0 .settings/org.eclipse.jdt.apt.core.prefs
  10. +298 −0 .settings/org.eclipse.jdt.core.prefs
  11. +4 −0 .settings/org.eclipse.jdt.ui.prefs
  12. +2 −0 .settings/org.eclipse.ltk.core.refactoring.prefs
  13. +4 −0 .settings/org.eclipse.m2e.core.prefs
  14. +201 −0 LICENSE
  15. +1,026 −0 experiments.im
  16. +385 −0 lib/BUCK
  17. +50 −0 prj.js
  18. +13 −0 src/BUCK
  19. +47 −0 src/DEFS
  20. +1 −0 src/META-INF/annotations/org.immutables.value.immutable
  21. +1 −0 src/META-INF/extensions/org.immutables.collect
  22. +7 −0 src/io/immutables/BUCK
  23. +15 −0 src/io/immutables/Unreachable.java
  24. +1 −0 src/io/immutables/collect/BUCK
  25. +12 −0 src/io/immutables/collect/Foldable.java
  26. +37 −0 src/io/immutables/collect/TestVect.java
  27. +420 −0 src/io/immutables/collect/Vect.java
  28. +25 −0 src/io/immutables/grammar/AstProduction.java
  29. +5 −0 src/io/immutables/grammar/BUCK
  30. +98 −0 src/io/immutables/grammar/Escapes.java
  31. +10 −0 src/io/immutables/grammar/Grammar.java
  32. +261 −0 src/io/immutables/grammar/LexerBase.java
  33. +17 −0 src/io/immutables/grammar/Node.java
  34. +55 −0 src/io/immutables/grammar/ParserBase.java
  35. +173 −0 src/io/immutables/grammar/Source.java
  36. +53 −0 src/io/immutables/grammar/Symbol.java
  37. +15 −0 src/io/immutables/grammar/fixture/BUCK
  38. +32 −0 src/io/immutables/grammar/fixture/Expr.grammar
  39. +6 −0 src/io/immutables/grammar/fixture/Expr.java
  40. +14 −0 src/io/immutables/grammar/fixture/SomeLex.grammar
  41. +6 −0 src/io/immutables/grammar/fixture/SomeLex.java
  42. +91 −0 src/io/immutables/grammar/fixture/TestFixture.java
  43. +109 −0 src/io/immutables/grammar/fixture/samples.grammar
  44. +17 −0 src/io/immutables/grammar/processor/BUCK
  45. +138 −0 src/io/immutables/grammar/processor/Codepoint.java
  46. +396 −0 src/io/immutables/grammar/processor/CodepointMatch.java
  47. +22 −0 src/io/immutables/grammar/processor/Debug.java
  48. +427 −0 src/io/immutables/grammar/processor/Generator.generator
  49. +113 −0 src/io/immutables/grammar/processor/Generator.java
  50. +273 −0 src/io/immutables/grammar/processor/Grammars.java
  51. +288 −0 src/io/immutables/grammar/processor/Parser.java
  52. +60 −0 src/io/immutables/grammar/processor/ParserActions.java
  53. +109 −0 src/io/immutables/grammar/processor/Processor.java
  54. +542 −0 src/io/immutables/grammar/processor/Production.java
  55. +84 −0 src/io/immutables/grammar/processor/TermDispatch.java
  56. +318 −0 src/io/immutables/grammar/processor/TermExpansion.java
  57. +13 −0 src/io/immutables/jaeger/BUCK
  58. +139 −0 src/io/immutables/jaeger/Composer.java
  59. +134 −0 src/io/immutables/jaeger/Confs.java
  60. +27 −0 src/io/immutables/jaeger/JaegerMain.java
  61. +16 −0 src/io/immutables/jaeger/MyView.java
  62. +146 −0 src/io/immutables/jaeger/Swagger.java
  63. +30 −0 src/io/immutables/jaeger/Tags.java
  64. +30 −0 src/io/immutables/jaeger/TestJaeger.java
  65. +8 −0 src/io/immutables/jaeger/View.java
  66. +21 −0 src/io/immutables/jaeger/api.test.jg
  67. +14 −0 src/io/immutables/jaeger/parse/BUCK
  68. +505 −0 src/io/immutables/jaeger/parse/Jaeger.grammar
  69. +6 −0 src/io/immutables/jaeger/parse/Jaeger.java
  70. +93 −0 src/io/immutables/jaeger/parse/ParserFacade.java
  71. +30 −0 src/io/immutables/jaeger/rest.test.im
  72. +15 −0 src/io/immutables/lang/BUCK
  73. +162 −0 src/io/immutables/lang/PrevSyntax.grammar
  74. +13 −0 src/io/immutables/lang/SourceRun.java
  75. +469 −0 src/io/immutables/lang/Syntax.grammar
  76. +6 −0 src/io/immutables/lang/Syntax.java
  77. +111 −0 src/io/immutables/lang/UnitCompiler.java
  78. +5 −0 src/io/immutables/lang/emit/BUCK
  79. +6 −0 src/io/immutables/lang/fixture/All.java
  80. +11 −0 src/io/immutables/lang/fixture/BUCK
  81. +32 −0 src/io/immutables/lang/fixture/Imc.java
  82. +3 −0 src/io/immutables/lang/fixture/TestAll.java
  83. +4 −0 src/io/immutables/lang/fixture/comments-only.test.im
  84. +21 −0 src/io/immutables/lang/fixture/concept-simple.test.im
  85. +14 −0 src/io/immutables/lang/fixture/data-constructors.test.im
  86. +56 −0 src/io/immutables/lang/fixture/debug.im
  87. +62 −0 src/io/immutables/lang/fixture/expressions.test.im
  88. +58 −0 src/io/immutables/lang/fixture/features.test.im
  89. +14 −0 src/io/immutables/lang/fixture/type-constraints.test.im
  90. +44 −0 src/io/immutables/lang/fixture/type-constructors.test.im
  91. +21 −0 src/io/immutables/lang/fixture/type-references.test.im
  92. +10 −0 src/io/immutables/lang/fixture/type-simple.test.im
  93. +29 −0 src/io/immutables/lang/fixture/unit.test.im
  94. +15 −0 src/io/immutables/lang/processor/BUCK
  95. +22 −0 src/io/immutables/lang/processor/Debug.java
  96. +79 −0 src/io/immutables/lang/processor/SourceRunProcessor.java
  97. +37 −0 src/io/immutables/lang/processor/SourceRuns.generator
  98. +48 −0 src/io/immutables/lang/processor/SourceRuns.java
  99. +4 −0 src/io/immutables/lang/type/BUCK
  100. +46 −0 src/io/immutables/lang/type/Constraint.java
  101. +56 −0 src/io/immutables/lang/type/Name.java
  102. +251 −0 src/io/immutables/lang/type/Type.java
  103. +8 −0 src/io/immutables/lang/type/notes.txt
  104. +1 −0 src/io/immutables/net/BUCK
  105. +294 −0 src/io/immutables/net/Ip4.java
  106. +54 −0 src/io/immutables/net/TestIpv4.java
  107. +9 −0 src/io/immutables/package-info.java
  108. +103 −0 src/io/immutables/that/Assert.java
  109. +134 −0 src/io/immutables/that/AssertionError.java
  110. +1 −0 src/io/immutables/that/BUCK
  111. +115 −0 src/io/immutables/that/Diff.java
  112. +510 −0 src/io/immutables/that/That.java
  113. +26 −0 type-experiment/irrr/Defs.java
  114. +150 −0 type-experiment/irrr/EmptyParameters.java
  115. +5 −0 type-experiment/irrr/ImportedPackage.java
  116. +8 −0 type-experiment/irrr/Imports.java
  117. +8 −0 type-experiment/irrr/Resolver.java
  118. +43 −0 type-experiment/irrr/TestParameters.java
  119. +16 −0 type-experiment/irrr/TypeDeclaration.java
  120. +76 −0 type-experiment/irrr/VariableSubstitution.java
View
@@ -0,0 +1,21 @@
[alias]
[project]
ignore = \
.classes, \
.git, \
.settings, \
.idea, \
.buckd
[java]
source_level = 1.8
target_level = 1.8
src_roots = src
[log]
max_traces = 1
compress_traces = true
[buildfile]
includes = //src/DEFS
View
@@ -0,0 +1,3 @@
-ea
-Xmx2g
-Xms1g
View
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path=".gen/src">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="buck-out/annotation/src/io/immutables/grammar/fixture/__fixture_gen__">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="buck-out/annotation/src/io/immutables/lang/__lang_gen__">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="buck-out/annotation/src/io/immutables/jaeger/parse/__parse_gen__">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="buck-out/annotation/src/io/immutables/lang/fixture/__fixture_gen__">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="lib" path="buck-out/gen/lib/guava_jar/guava-20.0.jar" sourcepath="buck-out/gen/lib/guava_src/guava-20.0-sources.jar"/>
<classpathentry kind="lib" path="buck-out/gen/lib/jsr305_jar/jsr305-3.0.1.jar" sourcepath="buck-out/gen/lib/jsr305_src/jsr305-3.0.1-sources.jar"/>
<classpathentry kind="lib" path="buck-out/gen/lib/junit_jar/junit-4.12.jar" sourcepath="buck-out/gen/lib/junit_src/junit-4.12-sources.jar"/>
<classpathentry kind="lib" path="buck-out/gen/lib/gson_jar/gson-2.8.0.jar" sourcepath="buck-out/gen/lib/gson_src/gson-2.8.0-sources.jar"/>
<classpathentry kind="lib" path="buck-out/gen/lib/jackson_jar/jackson-core-2.8.5.jar" sourcepath="buck-out/gen/lib/jackson_src/jackson-core-2.8.5-sources.jar"/>
<classpathentry kind="lib" path="buck-out/gen/lib/jackson_yaml_jar/jackson-dataformat-yaml-2.8.5.jar" sourcepath="buck-out/gen/lib/jackson_yaml_src/jackson-dataformat-yaml-2.8.5-sources.jar"/>
<classpathentry kind="lib" path="buck-out/gen/lib/retrofit_jar/retrofit-2.1.0.jar" sourcepath="buck-out/gen/lib/retrofit_src/retrofit-2.1.0-sources.jar"/>
<classpathentry kind="lib" path="buck-out/gen/lib/retrofit_gson_jar/converter-gson-2.1.0.jar" sourcepath="buck-out/gen/lib/retrofit_gson_src/converter-gson-2.1.0-sources.jar"/>
<classpathentry kind="lib" path="buck-out/gen/lib/okhttp_jar/okhttp-3.3.0.jar" sourcepath="buck-out/gen/lib/okhttp_src/okhttp-3.3.0-sources.jar"/>
<classpathentry kind="lib" path="buck-out/gen/lib/okio_jar/okio-1.11.0.jar" sourcepath="buck-out/gen/lib/okio_src/okio-1.11.0-sources.jar"/>
<classpathentry kind="lib" path="buck-out/gen/lib/snake_yaml_jar/snakeyaml-1.15.jar" sourcepath="buck-out/gen/lib/snake_yaml_src/snakeyaml-1.15-sources.jar"/>
<classpathentry kind="lib" path="buck-out/gen/lib/hamcrest_jar/hamcrest-core-1.3.jar" sourcepath="buck-out/gen/lib/hamcrest_src/hamcrest-core-1.3-sources.jar"/>
<classpathentry kind="lib" path="buck-out/gen/lib/immutables_trees_jar/trees-2.4.3.jar" sourcepath="buck-out/gen/lib/immutables_trees_src/trees-2.4.3-sources.jar"/>
<classpathentry kind="lib" path="buck-out/gen/lib/immutables_gson_jar/gson-2.4.3.jar" sourcepath="buck-out/gen/lib/immutables_gson_src/gson-2.4.3-sources.jar"/>
<classpathentry kind="lib" path="buck-out/gen/lib/immutables_ordinal_jar/ordinal-2.4.3.jar" sourcepath="buck-out/gen/lib/immutables_ordinal_src/ordinal-2.4.3-sources.jar"/>
<classpathentry kind="lib" path="buck-out/gen/lib/immutables_annotations_jar/value-2.4.3-annotations.jar" sourcepath="buck-out/gen/lib/immutables_annotations_src/value-2.4.3-annotations-sources.jar"/>
<classpathentry kind="lib" path="buck-out/gen/lib/immutables_generator_jar/generator-processor-2.4.3-luggage.jar" sourcepath="buck-out/gen/lib/immutables_generator_src/generator-processor-2.4.3-luggage-sources.jar"/>
<classpathentry kind="output" path=".classes"/>
</classpath>
View
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<factorypath>
<factorypathentry kind="WKSPJAR" id="/nextgen/buck-out/gen/src/metainf_extensions_jar.jar" enabled="true" runInBatchMode="false"/>,
<factorypathentry kind="WKSPJAR" id="/nextgen/buck-out/gen/lib/immutables_jar/value-2.4.3.jar" enabled="true" runInBatchMode="false"/>
</factorypath>
View
@@ -0,0 +1,6 @@
.DS_Store
.buckd/
.classes/
.idea/
.gen/
buck-out/
View
@@ -0,0 +1,227 @@
let childProcess = require('child_process')
let fs = require('fs')
let path = require('path')
const REPO1 = 'https://repo1.maven.org/maven2/'
const REPO_SONATYPE = 'https://oss.sonatype.org/content/groups/staging/'
const REPO = REPO1
const DIRN = __dirname.split('/').pop()
const LIB_BUCK = path.join(__dirname, 'lib', 'BUCK')
const EXT = {
jar: '.jar',
src: '-sources.jar',
sha1: '.sha1',
}
function exec(cmd) {
console.log(`> ${cmd}`)
return childProcess.execSync(cmd, {encoding: 'utf-8'})
}
class Gav {
constructor(string) {
this.data = string.split(':')
}
get group() {
let [group, artifact, version, classifier] = this.data
return group
}
get artifact() {
let [group, artifact, version, classifier] = this.data
return artifact
}
get version() {
let [group, artifact, version, classifier] = this.data
return version
}
get classifier() {
let [group, artifact, version, classifier] = this.data
return classifier
}
get filename() {
return [
this.artifact,
this.version,
this.classifier
].filter(Boolean).join('-')
}
get path() {
return [
this.group.replace(/\./g, '/'),
this.artifact,
this.version,
this.filename
].join('/')
}
toString() {
return this.data.filter(Boolean).join(':')
}
}
function readLibArtifacts(prj) {
let artifacts = []
for (let key in prj.lib) {
let gav = new Gav(prj.lib[key])
artifacts.push({
key,
gav,
deps: (prj.deps || {})[key],
nocp: (prj.classpath_exclude || {})[key] === true
})
}
return artifacts
}
function generateClasspath(libs, gen, apt, src) {
let srcEntries = [], libEntries = [], genEntries = []
for (let s of src) {
srcEntries.push(`
<classpathentry kind="src" path="${s}"/>`)
}
for (let l of libs.filter(v => !v.nocp)) {
libEntries.push(`
<classpathentry kind="lib" path="buck-out/gen/lib/${l.key}_jar/${l.gav.filename}${EXT.jar}" sourcepath="buck-out/gen/lib/${l.key}_src/${l.gav.filename}${EXT.src}"/>`)
}
for (let g of gen) {
genEntries.push(`
<classpathentry kind="src" path="${g}">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>`)
}
let classpath = `<?xml version="1.0" encoding="UTF-8"?>
<classpath>${srcEntries.join('')}${genEntries.join('')}
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>${libEntries.join('')}
<classpathentry kind="output" path=".classes"/>
</classpath>
`
fs.writeFileSync(path.join(__dirname, '.classpath'), classpath, 'utf-8')
let factoryEntries = []
for (let v of apt) {
let p = genjar(v)
if (p instanceof Array) {
libs.filter(v => v.key == p[1]).map(v => `
<factorypathentry kind="WKSPJAR" id="/${DIRN}/buck-out/gen/lib/${v.key}_jar/${v.gav.filename}${EXT.jar}" enabled="true" runInBatchMode="false"/>`).forEach(e => factoryEntries.push(e))
} else {
factoryEntries.push(`
<factorypathentry kind="WKSPJAR" id="/${DIRN}/${p}" enabled="true" runInBatchMode="false"/>`)
}
}
let factorypath = `<?xml version="1.0" encoding="UTF-8"?>
<factorypath>${factoryEntries}
</factorypath>
`
fs.writeFileSync(path.join(__dirname, '.factorypath'), factorypath, 'utf-8')
}
// unused, the strategy when jar files are in source control
function downloadAndGenerateLibs(libs) {
exec(`rm -rf .newlib; mkdir .newlib`)
for (let {gav} of libs) {
exec(`curl ${REPO}${gav.path}${EXT.jar} > .newlib/${gav.filename}${EXT.jar}`)
exec(`curl ${REPO}${gav.path}${EXT.srcJar} > .newlib/${gav.filename}${EXT.src}`)
}
let libRules = ''
for (let l of libs) {
libRules += `
prebuilt_jar(
name = '${l.key}',
binary_jar = '${l.gav.filename}${EXT.jar}',
source_jar = '${l.gav.filename}${EXT.src}',
visibility = ['//...'],${ l.deps ? `
deps = [${l.deps.map(d => `':${d}'`)}]` : '' }
)
`
}
fs.writeFileSync(path.join(__dirname, '.newlib', 'BUCK'), libRules, 'utf-8')
exec(`rm -rf lib; mv .newlib lib`)
}
function generateAndFetchLibs(libs) {
let sha1Jar = {}, sha1Src = {}
for (let {gav} of libs) {
sha1Jar[gav] = exec(`curl ${REPO}${gav.path}${EXT.jar}${EXT.sha1}`).trim()
sha1Src[gav] = exec(`curl ${REPO}${gav.path}${EXT.src}${EXT.sha1}`).trim()
}
let libRules = ''
for (let l of libs) {
libRules += `
prebuilt_jar(
name = '${l.key}',
binary_jar = ':${l.key}_jar',
source_jar = ':${l.key}_src',
visibility = ['//...'],${ l.deps ? `
deps = [${l.deps.map(d => `':${d}'`)}]` : '' }
)
remote_file(
name = '${l.key}_jar',
out = '${l.gav.filename}${EXT.jar}',
url = '${REPO}${l.gav.path}${EXT.jar}',
sha1 = '${sha1Jar[l.gav]}'
)
remote_file(
name = '${l.key}_src',
out = '${l.gav.filename}${EXT.src}',
url = '${REPO}${l.gav.path}${EXT.src}',
sha1 = '${sha1Src[l.gav]}'
)
`
}
fs.writeFileSync(LIB_BUCK, libRules, 'utf-8')
exec(`buck fetch //...`)
}
exports.project = function(prj) {
let libs = readLibArtifacts(prj)
generateAndFetchLibs(libs)
generateClasspath(libs, prj.gen || [], prj.eclipse_apt || {}, prj.src || ['src'])
}
exports.gensrc = function(buckTarget) {
let [path, goal] = buckTarget.split(':')
path = path.indexOf('//') == 0
? path.slice(2)
: path
return `buck-out/annotation/${path}/__${goal}_gen__`
}
function genjar(buckTarget) {
let [path, goal] = buckTarget.split(':')
path = path.indexOf('//') == 0
? path.slice(2)
: path
if (path == 'lib') {
return [path, goal]
}
return `buck-out/gen/${path}/${goal}.jar`
}
View
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>nextgen</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
@@ -0,0 +1,4 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
encoding/src=UTF-8
encoding/test=UTF-8
@@ -0,0 +1,4 @@
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=true
org.eclipse.jdt.apt.genSrcDir=.gen/src
org.eclipse.jdt.apt.reconcileEnabled=true
Oops, something went wrong.

0 comments on commit 7b90308

Please sign in to comment.