Skip to content

Commit

Permalink
Merge branch 'xwiki:master' into XWIKI-22165
Browse files Browse the repository at this point in the history
  • Loading branch information
Sereza7 authored Sep 11, 2024
2 parents 2f71bec + 61a97e5 commit a0815ef
Show file tree
Hide file tree
Showing 158 changed files with 30,971 additions and 273 deletions.
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.1.0 https://maven.apach
<extension>
<groupId>com.gradle</groupId>
<artifactId>develocity-maven-extension</artifactId>
<version>1.22</version>
<version>1.22.1</version>
</extension>
<extension>
<groupId>com.gradle</groupId>
Expand Down
36 changes: 23 additions & 13 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,29 @@ def builds = [
)
},
'Quality' : {
// Run the quality checks.
// Sonar notes:
// - we need sonar:sonar to perform the analysis and push the results to Sonarcloud
// - we need jacoco:report to execute jacoco and compute test coverage
// - we need -Pcoverage and -Dxwiki.jacoco.itDestFile to tell Jacoco to compute a single global Jacoco
// coverage for the full reactor (so that the coverage percentage computed takes into account module tests
// which cover code in other modules)
build(
name: 'Quality',
goals: 'clean install jacoco:report sonar:sonar',
profiles: 'quality,legacy,coverage',
properties: '-Dxwiki.jacoco.itDestFile=`pwd`/target/jacoco-it.exec'
)
node() {
// Run the quality checks.
// Notes for step 1:
// - The build executes jacoco to generate a single jacoco exec file containing the results of the coverage
// for all tests from all modules. This why we need -Pcoverage and -Dxwiki.jacoco.itDestFile.
buildInsideNode(
name: 'Quality Step 1',
goals: 'clean install',
profiles: 'repository-snapshots,quality,legacy,coverage',
properties: '-Dxwiki.jacoco.itDestFile=`pwd`/target/jacoco-it.exec'
)
// Notes for step 2:
// - We generate the jacoco reports for all modules (all from the single jacoco-it.exec file)
// - We then generate the sonar analysis and upload to Sonarcloud with the sonar:sonar goal.
// - Sonar uses the jacoco report files and it's thus important that the sonar:sonar goal is executed after
// the jacoco:report one.
buildInsideNode(
name: 'Quality Step 2',
goals: 'jacoco:report sonar:sonar',
profiles: 'repository-snapshots,quality,legacy,coverage',
properties: '-Dxwiki.jacoco.itDestFile=`pwd`/target/jacoco-it.exec'
)
}
}
]

Expand Down
51 changes: 44 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
<platform.version>${commons.version}</platform.version>

<!-- Dependencies versions -->
<bootstrap.version>3.4.1</bootstrap.version>
<batik.version>1.17</batik.version>
<restlet.version>2.3.12</restlet.version>
<tika.version>2.9.2</tika.version>
Expand Down Expand Up @@ -486,19 +485,19 @@
<artifactId>bootstrap-select</artifactId>
<version>1.13.18</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>bootstrap-3-typeahead</artifactId>
<version>4.0.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>${bootstrap.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>Keypress</artifactId>
Expand All @@ -516,12 +515,24 @@
<artifactId>bootstrap-daterangepicker</artifactId>
<version>3.1</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>selectize.js</artifactId>
<version>0.13.3</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- All Batik artifacts should be in sync -->
Expand Down Expand Up @@ -701,6 +712,12 @@
<artifactId>bootstrap-switch</artifactId>
<version>3.3.4</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--Used by oldcore + querymanager -->
<dependency>
Expand Down Expand Up @@ -1669,6 +1686,26 @@
</rules>
</configuration>
</execution>
<!-- Make sure the old bootstrap webjar extension is not used. -->
<execution>
<id>enforce-bootstrap-platform</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<bannedDependencies>
<searchTransitive>true</searchTransitive>
<message>
Do not use the official org.webjar:bootstrap extension. Is it now packaged in xwiki platform.
</message>
<excludes>
<exclude>org.webjars:bootstrap</exclude>
</excludes>
</bannedDependencies>
</rules>
</configuration>
</execution>
<!-- Make sure JAR extensions don't trigger runtime dependencies on XAR extensions -->
<execution>
<id>enforcer-banneddependencytype-xar</id>
Expand Down
1 change: 1 addition & 0 deletions xwiki-platform-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
<module>xwiki-platform-application</module>
<module>xwiki-platform-appwithinminutes</module>
<module>xwiki-platform-attachment</module>
<module>xwiki-platform-bootstrap</module>
<module>xwiki-platform-bridge</module>
<module>xwiki-platform-captcha</module>
<module>xwiki-platform-chart</module>
Expand Down
5 changes: 5 additions & 0 deletions xwiki-platform-core/xwiki-platform-bootstrap/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This directory material is a fork of twbs/bootstrap 3.4.x branch with some specific fixes for XWiki.

## Copyright and license

Code and documentation copyright 2011-2019 Twitter, Inc. Code released under [the MIT license](https://github.com/twbs/bootstrap/blob/master/LICENSE). Docs released under [Creative Commons](https://github.com/twbs/bootstrap/blob/master/docs/LICENSE).
190 changes: 190 additions & 0 deletions xwiki-platform-core/xwiki-platform-bootstrap/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-core</artifactId>
<version>16.8.0-SNAPSHOT</version>
</parent>
<packaging>webjar</packaging>
<artifactId>xwiki-platform-bootstrap</artifactId>
<name>XWiki Platform - Bootstrap</name>
<properties>
<!-- Name to display by the Extension Manager -->
<xwiki.extension.name>Bootstrap WebJar</xwiki.extension.name>
<!-- Category for the Extension Manager -->
<xwiki.extension.category>webjar</xwiki.extension.category>
<!-- Old name of this module used for retro compatibility when resolving dependencies of old extensions -->
<xwiki.extension.features>org.webjars:bootstrap</xwiki.extension.features>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-bootstrap-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/bootstrap</outputDirectory>
<resources>
<resource>
<directory>src/main/</directory>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-bootstrap-tests-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/bootstrap/js/tests</outputDirectory>
<resources>
<resource>
<directory>src/tests/</directory>
</resource>
</resources>
</configuration>
</execution>
<execution>
<!-- Copy the generated bootstrap components to the WebJar folder. -->
<id>copy-bootstrap-components</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}/META-INF/resources/webjars/${project.artifactId}/${project.version}</outputDirectory>
<resources>
<resource>
<directory>${project.build.directory}/bootstrap/dist</directory>
</resource>
</resources>
</configuration>
</execution>
<execution>
<!-- Copy the less bootstrap components to the WebJar folder. -->
<id>copy-bootstrap-less-components</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}/META-INF/resources/webjars/${project.artifactId}/${project.version}/less</outputDirectory>
<resources>
<resource>
<directory>${project.build.directory}/bootstrap/less</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- We're disabling the JSHint check associated with the WebJar packaging because we use frontend-maven-plugin
below to perform linting. -->
<plugin>
<groupId>org.xwiki.contrib</groupId>
<artifactId>jshint-maven-plugin</artifactId>
<executions>
<execution>
<id>default-lint</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>install-node-and-npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>${node.version}</nodeVersion>
<npmVersion>${npm.version}</npmVersion>
</configuration>
</execution>
<execution>
<id>npm-install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>ci</arguments>
</configuration>
</execution>
<execution>
<id>npm-run-build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
<execution>
<id>npm-run-test</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run test</arguments>
</configuration>
<phase>test</phase>
</execution>
<execution>
<id>npm-run-lint</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run lint</arguments>
</configuration>
<phase>test</phase>
</execution>
</executions>
<configuration>
<workingDirectory>${project.build.directory}/bootstrap/</workingDirectory>
</configuration>
</plugin>
<!-- We're skipping the license check because we put the actual original license in bootstrap file and not the
XWiki license -->
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/dist/
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
Loading

0 comments on commit a0815ef

Please sign in to comment.