Merge branch 'stable-2.6' into stable-2.7

* stable-2.6:
  Prevent expansion when whole file isn't loaded
  Generate javadoc for gerrit extension and plugin API
This commit is contained in:
Shawn Pearce
2013-10-07 14:51:55 -07:00
5 changed files with 126 additions and 6 deletions

View File

@@ -81,6 +81,49 @@ limitations under the License.
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-artifact-sources</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>gerrit-extension-api</artifactId>
<version>${project.version}</version>
<classifier>all-sources</classifier>
<overWrite>true</overWrite>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/unpack_sources</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<sourcepath>${project.build.directory}/unpack_sources</sourcepath>
<encoding>ISO-8859-1</encoding>
<quiet>true</quiet>
<detectOfflineLinks>false</detectOfflineLinks>
</configuration>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
<phase>process-resources</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -209,7 +209,7 @@ public class SideBySideTable extends AbstractPatchContentTable {
for (int row = 0; row < lines.size(); row++) {
setRowItem(row, lines.get(row));
if (lines.get(row) instanceof SkippedLine) {
createSkipLine(row, (SkippedLine) lines.get(row));
createSkipLine(row, (SkippedLine) lines.get(row), script.getA().isWholeFile());
}
}
}
@@ -540,16 +540,18 @@ public class SideBySideTable extends AbstractPatchContentTable {
if (numRows > 0) {
line.incrementStart(numRows);
createSkipLine(row + loopTo, line);
// If we got here, we must have the whole file anyway.
createSkipLine(row + loopTo, line, true);
} else if (numRows < 0) {
line.reduceSize(-numRows);
createSkipLine(row, line);
// If we got here, we must have the whole file anyway.
createSkipLine(row, line, true);
} else {
table.removeRow(row + loopTo);
}
}
private void createSkipLine(int row, SkippedLine line) {
private void createSkipLine(int row, SkippedLine line, boolean isWholeFile) {
FlowPanel p = new FlowPanel();
InlineLabel l1 = new InlineLabel(" " + PatchUtil.C.patchSkipRegionStart() + " ");
InlineLabel l2 = new InlineLabel(" " + PatchUtil.C.patchSkipRegionEnd() + " ");
@@ -558,7 +560,7 @@ public class SideBySideTable extends AbstractPatchContentTable {
all.addClickHandler(expandAllListener);
all.setStyleName(Gerrit.RESOURCES.css().skipLine());
if (line.getSize() > 30) {
if (line.getSize() > 30 && isWholeFile) {
// Only show the expand before/after if skipped more than 30 lines.
Anchor b = new Anchor(PatchUtil.M.expandBefore(NUM_ROWS_TO_EXPAND), true);
Anchor a = new Anchor(PatchUtil.M.expandAfter(NUM_ROWS_TO_EXPAND), true);
@@ -574,10 +576,14 @@ public class SideBySideTable extends AbstractPatchContentTable {
p.add(all);
p.add(l2);
p.add(a);
} else {
} else if (isWholeFile) {
p.add(l1);
p.add(all);
p.add(l2);
} else {
p.add(l1);
p.add(new InlineLabel(" " + line.getSize() + " "));
p.add(l2);
}
table.setWidget(row, 1, p);
}

View File

@@ -117,6 +117,50 @@ limitations under the License.
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-artifact-sources</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>gerrit-plugin-api</artifactId>
<version>${project.version}</version>
<classifier>sources</classifier>
<overWrite>true</overWrite>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/unpack_sources</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.7</version>
<configuration>
<sourcepath>${project.build.directory}/unpack_sources</sourcepath>
<encoding>ISO-8859-1</encoding>
<quiet>true</quiet>
<detectOfflineLinks>false</detectOfflineLinks>
</configuration>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
<phase>process-resources</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -355,6 +355,12 @@ limitations under the License.
<version>2.1.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>

View File

@@ -38,6 +38,16 @@ mvn deploy:deploy-file \
-DrepositoryId=gerrit-api-repository \
-Durl=$URL
mvn deploy:deploy-file \
-DgroupId=com.google.gerrit \
-DartifactId=gerrit-extension-api \
-Dversion=$VER \
-Dpackaging=jar \
-Dfile=gerrit-extension-api/target/gerrit-extension-api-$VER-javadoc.jar \
-Djava-source=false \
-DrepositoryId=gerrit-api-repository \
-Durl=$URL
echo "Deploying $type gerrit-plugin-api $VER"
mvn deploy:deploy-file \
@@ -58,3 +68,14 @@ mvn deploy:deploy-file \
-Djava-source=false \
-DrepositoryId=gerrit-api-repository \
-Durl=$URL
mvn deploy:deploy-file \
-DgroupId=com.google.gerrit \
-DartifactId=gerrit-plugin-api \
-Dversion=$VER \
-Dpackaging=jar \
-Dfile=gerrit-plugin-api/target/gerrit-plugin-api-$VER-javadoc.jar \
-Djava-source=false \
-DrepositoryId=gerrit-api-repository \
-Durl=$URL