aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-vsts
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2019-05-16 14:54:03 +0200
committerSonarTech <sonartech@sonarsource.com>2019-05-16 20:21:08 +0200
commit9240dd9a15b317d94c1db5c94281398a16b2b36a (patch)
treebd6b1f9f2b87710c647f67ef57cbf0f098c91f1c /server/sonar-vsts
parentde0777600015768d08792db2864a3c595654435c (diff)
downloadsonarqube-9240dd9a15b317d94c1db5c94281398a16b2b36a.tar.gz
sonarqube-9240dd9a15b317d94c1db5c94281398a16b2b36a.zip
Fix dependencies (order) between Gradle tasks that execute yarn
And add declarations of input files for "yarn_validate-ci" tasks, which were forgotten when caching was enabled for them.
Diffstat (limited to 'server/sonar-vsts')
-rw-r--r--server/sonar-vsts/build.gradle18
-rw-r--r--server/sonar-vsts/config/webpack.config.js7
-rw-r--r--server/sonar-vsts/package.json5
-rw-r--r--server/sonar-vsts/src/main/js/components/Configuration.tsx4
-rw-r--r--server/sonar-vsts/src/main/js/components/LoginForm.tsx6
-rw-r--r--server/sonar-vsts/src/main/js/components/LoginLink.tsx2
-rw-r--r--server/sonar-vsts/src/main/js/components/ProjectSelector.tsx2
-rw-r--r--server/sonar-vsts/src/main/js/components/ProjectSelectorItem.tsx2
-rw-r--r--server/sonar-vsts/src/main/js/components/QGWidget.tsx7
-rw-r--r--server/sonar-vsts/src/main/js/components/SonarCloudIcon.tsx2
-rw-r--r--server/sonar-vsts/src/main/js/components/Widget.tsx2
-rw-r--r--server/sonar-vsts/tsconfig.json5
12 files changed, 42 insertions, 20 deletions
diff --git a/server/sonar-vsts/build.gradle b/server/sonar-vsts/build.gradle
index d6ecf126fc1..62cd909ea53 100644
--- a/server/sonar-vsts/build.gradle
+++ b/server/sonar-vsts/build.gradle
@@ -19,11 +19,18 @@ yarn_run {
].each {
inputs.dir(it).withPathSensitivity(PathSensitivity.RELATIVE)
}
- ['babel.config.js', 'package.json', 'tsconfig.json', 'yarn.lock'].each {
+ ['babel.config.js', 'package.json', 'tsconfig.json', 'yarn.lock',
+ '../sonar-web/package.json',
+ '../sonar-web/yarn.lock'
+ ].each {
inputs.file(it).withPathSensitivity(PathSensitivity.RELATIVE)
}
outputs.dir('build/webapp')
outputs.cacheIf { true }
+
+ // sonar-web dependencies needs to be installed before we build sonar-vsts otherwise the sonar-web components
+ // that sonar-vsts depends uppon won't find their node_modules
+ dependsOn(':server:sonar-web:yarn')
args = ['build']
}
build.dependsOn(yarn_run)
@@ -38,12 +45,19 @@ build.dependsOn(yarn_run)
].each {
inputs.dir(it)
}
- ['package.json', 'yarn.lock', 'tsconfig.json', '.eslintrc', '.eslintignore'].each {
+ ['package.json', 'yarn.lock', 'tsconfig.json', '.eslintrc', '.eslintignore',
+ '../sonar-web/package.json',
+ '../sonar-web/yarn.lock'
+ ].each {
inputs.file(it)
}
outputs.file('eslint-report.json')
outputs.dir('coverage')
outputs.cacheIf { true }
+
+ // sonar-web dependencies needs to be installed before we build sonar-vsts otherwise the sonar-web components
+ // that sonar-vsts depends uppon won't find their node_modules
+ dependsOn(yarn, ':server:sonar-web:yarn')
}
def sources = fileTree(dir: "src") + fileTree(dir: "scripts") + fileTree(dir: "config")
diff --git a/server/sonar-vsts/config/webpack.config.js b/server/sonar-vsts/config/webpack.config.js
index f34c0d55420..a650793501e 100644
--- a/server/sonar-vsts/config/webpack.config.js
+++ b/server/sonar-vsts/config/webpack.config.js
@@ -32,7 +32,12 @@ module.exports = ({ production = true }) => ({
devtool: production ? 'source-map' : 'cheap-module-source-map',
resolve: {
// Add '.ts' and '.tsx' as resolvable extensions.
- extensions: ['.ts', '.tsx', '.js', '.json']
+ extensions: ['.ts', '.tsx', '.js', '.json'],
+ alias: {
+ '@sqapi': path.resolve(__dirname, '../../sonar-web/src/main/js/api'),
+ '@sqcomponents': path.resolve(__dirname, '../../sonar-web/src/main/js/components'),
+ '@sqhelpers': path.resolve(__dirname, '../../sonar-web/src/main/js/helpers')
+ }
},
entry: [
!production && require.resolve('react-dev-utils/webpackHotDevClient'),
diff --git a/server/sonar-vsts/package.json b/server/sonar-vsts/package.json
index 0e1bf9d4fec..ea40f80df72 100644
--- a/server/sonar-vsts/package.json
+++ b/server/sonar-vsts/package.json
@@ -117,7 +117,10 @@
],
"moduleNameMapper": {
"^.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/config/jest/FileStub.js",
- "^.+\\.css$": "<rootDir>/config/jest/CSSStub.js"
+ "^.+\\.css$": "<rootDir>/config/jest/CSSStub.js",
+ "^@sqapi(.*)$": "<rootDir>/../sonar-web/src/main/js/api$1",
+ "^@sqcomponents(.*)$": "<rootDir>/../sonar-web/src/main/js/components$1",
+ "^@sqhelpers(.*)$": "<rootDir>/../sonar-web/src/main/js/helpers$1"
},
"setupFiles": [
"<rootDir>/config/polyfills.js",
diff --git a/server/sonar-vsts/src/main/js/components/Configuration.tsx b/server/sonar-vsts/src/main/js/components/Configuration.tsx
index 5b659ed8b3c..e622cf20f03 100644
--- a/server/sonar-vsts/src/main/js/components/Configuration.tsx
+++ b/server/sonar-vsts/src/main/js/components/Configuration.tsx
@@ -18,9 +18,10 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { Component, searchProjects } from '@sqapi/components';
+import { getCurrentUser } from '@sqapi/users';
import LoginForm from './LoginForm';
import ProjectSelector from './ProjectSelector';
-import { Component, searchProjects } from '../../../../../sonar-web/src/main/js/api/components';
import {
Settings,
VSTSWidgetSettings,
@@ -28,7 +29,6 @@ import {
serializeWidgetSettings,
parseWidgetSettings
} from '../utils';
-import { getCurrentUser } from '../../../../../sonar-web/src/main/js/api/users';
interface Props {
contribution: string;
diff --git a/server/sonar-vsts/src/main/js/components/LoginForm.tsx b/server/sonar-vsts/src/main/js/components/LoginForm.tsx
index 84845a31e42..7141de30d4f 100644
--- a/server/sonar-vsts/src/main/js/components/LoginForm.tsx
+++ b/server/sonar-vsts/src/main/js/components/LoginForm.tsx
@@ -18,12 +18,12 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { getTextColor } from '@sqhelpers/colors';
+import { getBaseUrl } from '@sqhelpers/urls';
+import { getIdentityProviders } from '@sqapi/users';
import LoginLink from './LoginLink';
import SonarCloudIcon from './SonarCloudIcon';
import * as theme from '../../../../../sonar-web/src/main/js/app/theme';
-import { getIdentityProviders } from '../../../../../sonar-web/src/main/js/api/users';
-import { getTextColor } from '../../../../../sonar-web/src/main/js/helpers/colors';
-import { getBaseUrl } from '../../../../../sonar-web/src/main/js/helpers/urls';
interface Props {
onReload: () => void;
diff --git a/server/sonar-vsts/src/main/js/components/LoginLink.tsx b/server/sonar-vsts/src/main/js/components/LoginLink.tsx
index 642fd354cb4..3f068f7f876 100644
--- a/server/sonar-vsts/src/main/js/components/LoginLink.tsx
+++ b/server/sonar-vsts/src/main/js/components/LoginLink.tsx
@@ -18,7 +18,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { getBaseUrl } from '../../../../../sonar-web/src/main/js/helpers/urls';
+import { getBaseUrl } from '@sqhelpers/urls';
interface Props {
className?: string;
diff --git a/server/sonar-vsts/src/main/js/components/ProjectSelector.tsx b/server/sonar-vsts/src/main/js/components/ProjectSelector.tsx
index 8203b8f57f6..92a719c7bdb 100644
--- a/server/sonar-vsts/src/main/js/components/ProjectSelector.tsx
+++ b/server/sonar-vsts/src/main/js/components/ProjectSelector.tsx
@@ -20,8 +20,8 @@
import * as React from 'react';
import * as classNames from 'classnames';
import { debounce } from 'lodash';
+import { Component } from '@sqapi/components';
import ProjectSelectorItem from './ProjectSelectorItem';
-import { Component } from '../../../../../sonar-web/src/main/js/api/components';
interface Props {
isLoggedIn: boolean;
diff --git a/server/sonar-vsts/src/main/js/components/ProjectSelectorItem.tsx b/server/sonar-vsts/src/main/js/components/ProjectSelectorItem.tsx
index e1dfe927522..4f63ceb327c 100644
--- a/server/sonar-vsts/src/main/js/components/ProjectSelectorItem.tsx
+++ b/server/sonar-vsts/src/main/js/components/ProjectSelectorItem.tsx
@@ -19,7 +19,7 @@
*/
import * as React from 'react';
import * as classNames from 'classnames';
-import { Component } from '../../../../../sonar-web/src/main/js/api/components';
+import { Component } from '@sqapi/components';
interface Props {
isActive: boolean;
diff --git a/server/sonar-vsts/src/main/js/components/QGWidget.tsx b/server/sonar-vsts/src/main/js/components/QGWidget.tsx
index e20a0c0d23a..ce3fb4b67d1 100644
--- a/server/sonar-vsts/src/main/js/components/QGWidget.tsx
+++ b/server/sonar-vsts/src/main/js/components/QGWidget.tsx
@@ -19,12 +19,9 @@
*/
import * as React from 'react';
import * as classNames from 'classnames';
+import { getPathUrlAsString, getProjectUrl } from '@sqhelpers/urls';
+import Tooltip from '@sqcomponents/controls/Tooltip';
import SonarCloudIcon from './SonarCloudIcon';
-import Tooltip from '../../../../../sonar-web/src/main/js/components/controls/Tooltip';
-import {
- getPathUrlAsString,
- getProjectUrl
-} from '../../../../../sonar-web/src/main/js/helpers/urls';
interface Props {
component: T.ComponentMeasure;
diff --git a/server/sonar-vsts/src/main/js/components/SonarCloudIcon.tsx b/server/sonar-vsts/src/main/js/components/SonarCloudIcon.tsx
index f57cb379f79..b1f80052ae0 100644
--- a/server/sonar-vsts/src/main/js/components/SonarCloudIcon.tsx
+++ b/server/sonar-vsts/src/main/js/components/SonarCloudIcon.tsx
@@ -18,7 +18,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { IconProps } from '../../../../../sonar-web/src/main/js/components/icons-components/Icon';
+import { IconProps } from '@sqcomponents/icons-components/Icon';
export default function SonarCloudIcon({ className, fill = '#f3702a', size = 18 }: IconProps) {
return (
diff --git a/server/sonar-vsts/src/main/js/components/Widget.tsx b/server/sonar-vsts/src/main/js/components/Widget.tsx
index 9cd912fb4e8..8720b6a9317 100644
--- a/server/sonar-vsts/src/main/js/components/Widget.tsx
+++ b/server/sonar-vsts/src/main/js/components/Widget.tsx
@@ -18,9 +18,9 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
+import { getMeasuresAndMeta } from '@sqapi/measures';
import QGWidget from './QGWidget';
import LoginForm from './LoginForm';
-import { getMeasuresAndMeta } from '../../../../../sonar-web/src/main/js/api/measures';
import { Settings } from '../utils';
interface Props {
diff --git a/server/sonar-vsts/tsconfig.json b/server/sonar-vsts/tsconfig.json
index bbab74e1bbb..4713fd26cff 100644
--- a/server/sonar-vsts/tsconfig.json
+++ b/server/sonar-vsts/tsconfig.json
@@ -14,7 +14,10 @@
"moduleResolution": "node",
"baseUrl": "./",
"paths": {
- "*": ["../sonar-web/node_modules/@types/*", "./node_modules/@types/*", "*"]
+ "@sqapi/*": ["../sonar-web/src/main/js/api/*"],
+ "@sqcomponents/*": ["../sonar-web/src/main/js/components/*"],
+ "@sqhelpers/*": ["../sonar-web/src/main/js/helpers/*"],
+ "*": ["./node_modules/@types/*", "../sonar-web/node_modules/@types/*", "*"]
},
"sourceMap": true
},